@solostylist/ui-kit-native 1.0.1 → 1.0.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.
- package/dist/hooks/use-count-down.d.ts +0 -2
- package/dist/hooks/use-count-down.d.ts.map +1 -1
- package/dist/hooks/use-count-down.js +0 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/s-avatar/s-avatar.d.ts +4 -8
- package/dist/s-avatar/s-avatar.d.ts.map +1 -1
- package/dist/s-avatar/s-avatar.js +49 -42
- package/dist/s-button/s-button.d.ts +0 -2
- package/dist/s-button/s-button.d.ts.map +1 -1
- package/dist/s-button/s-button.js +27 -24
- package/dist/s-button-link/s-button-link.d.ts +0 -2
- package/dist/s-button-link/s-button-link.d.ts.map +1 -1
- package/dist/s-button-link/s-button-link.js +21 -26
- package/dist/s-chat-input/index.d.ts +1 -1
- package/dist/s-chat-input/index.d.ts.map +1 -1
- package/dist/s-chat-input/s-chat-input.d.ts +19 -8
- package/dist/s-chat-input/s-chat-input.d.ts.map +1 -1
- package/dist/s-chat-input/s-chat-input.js +115 -46
- package/dist/s-chat-message/s-chat-message.d.ts +5 -7
- package/dist/s-chat-message/s-chat-message.d.ts.map +1 -1
- package/dist/s-chat-message/s-chat-message.js +100 -175
- package/dist/s-checkbox/s-checkbox.d.ts +0 -2
- package/dist/s-checkbox/s-checkbox.d.ts.map +1 -1
- package/dist/s-checkbox/s-checkbox.js +11 -18
- package/dist/s-chip/s-chip.d.ts +0 -2
- package/dist/s-chip/s-chip.d.ts.map +1 -1
- package/dist/s-chip/s-chip.js +35 -54
- package/dist/s-code-block/s-code-block.d.ts +0 -2
- package/dist/s-code-block/s-code-block.d.ts.map +1 -1
- package/dist/s-code-block/s-code-block.js +28 -40
- package/dist/s-comment-message/s-comment-message.d.ts +3 -5
- package/dist/s-comment-message/s-comment-message.d.ts.map +1 -1
- package/dist/s-comment-message/s-comment-message.js +54 -167
- package/dist/s-copyable-text/s-copyable-text.d.ts +0 -2
- package/dist/s-copyable-text/s-copyable-text.d.ts.map +1 -1
- package/dist/s-copyable-text/s-copyable-text.js +20 -45
- package/dist/s-countdown/index.d.ts +0 -1
- package/dist/s-countdown/index.d.ts.map +1 -1
- package/dist/s-countdown/index.js +0 -1
- package/dist/s-countdown/s-count-box.d.ts +5 -3
- package/dist/s-countdown/s-count-box.d.ts.map +1 -1
- package/dist/s-countdown/s-count-box.js +69 -60
- package/dist/s-countdown/s-countdown.d.ts +6 -3
- package/dist/s-countdown/s-countdown.d.ts.map +1 -1
- package/dist/s-countdown/s-countdown.js +11 -10
- package/dist/s-data-table/s-data-table.d.ts +0 -3
- package/dist/s-data-table/s-data-table.d.ts.map +1 -1
- package/dist/s-data-table/s-data-table.js +27 -50
- package/dist/s-date-picker/s-date-picker.d.ts +0 -2
- package/dist/s-date-picker/s-date-picker.d.ts.map +1 -1
- package/dist/s-date-picker/s-date-picker.js +51 -110
- package/dist/s-date-time-picker/s-date-time-picker.d.ts +0 -2
- package/dist/s-date-time-picker/s-date-time-picker.d.ts.map +1 -1
- package/dist/s-date-time-picker/s-date-time-picker.js +111 -203
- package/dist/s-divider/index.d.ts +2 -0
- package/dist/s-divider/index.d.ts.map +1 -0
- package/dist/s-divider/index.js +1 -0
- package/dist/s-divider/s-divider.d.ts +24 -0
- package/dist/s-divider/s-divider.d.ts.map +1 -0
- package/dist/s-divider/s-divider.js +30 -0
- package/dist/s-file-dropzone/s-file-dropzone.d.ts +0 -35
- package/dist/s-file-dropzone/s-file-dropzone.d.ts.map +1 -1
- package/dist/s-file-dropzone/s-file-dropzone.js +46 -120
- package/dist/s-file-icon/s-file-icon.d.ts +0 -2
- package/dist/s-file-icon/s-file-icon.d.ts.map +1 -1
- package/dist/s-file-icon/s-file-icon.js +11 -12
- package/dist/s-form/s-form.d.ts +0 -1
- package/dist/s-form/s-form.d.ts.map +1 -1
- package/dist/s-form/s-form.js +0 -1
- package/dist/s-icon-button/s-icon-button.d.ts +9 -9
- package/dist/s-icon-button/s-icon-button.d.ts.map +1 -1
- package/dist/s-icon-button/s-icon-button.js +38 -4
- package/dist/s-image-comparison/s-image-comparison.d.ts +3 -5
- package/dist/s-image-comparison/s-image-comparison.d.ts.map +1 -1
- package/dist/s-image-comparison/s-image-comparison.js +75 -102
- package/dist/s-label/s-label.d.ts +0 -1
- package/dist/s-label/s-label.d.ts.map +1 -1
- package/dist/s-label/s-label.js +8 -24
- package/dist/s-language-switcher/s-language-switcher.d.ts +2 -5
- package/dist/s-language-switcher/s-language-switcher.d.ts.map +1 -1
- package/dist/s-language-switcher/s-language-switcher.js +14 -25
- package/dist/s-lazy-image/s-lazy-image.d.ts +4 -6
- package/dist/s-lazy-image/s-lazy-image.d.ts.map +1 -1
- package/dist/s-lazy-image/s-lazy-image.js +37 -34
- package/dist/s-moving-border/s-moving-border.d.ts +0 -2
- package/dist/s-moving-border/s-moving-border.d.ts.map +1 -1
- package/dist/s-moving-border/s-moving-border.js +19 -24
- package/dist/s-multi-select/s-multi-select.d.ts +0 -2
- package/dist/s-multi-select/s-multi-select.d.ts.map +1 -1
- package/dist/s-multi-select/s-multi-select.js +54 -105
- package/dist/s-pagination/s-pagination.d.ts +12 -6
- package/dist/s-pagination/s-pagination.d.ts.map +1 -1
- package/dist/s-pagination/s-pagination.js +69 -43
- package/dist/s-rating/s-rating.d.ts +0 -2
- package/dist/s-rating/s-rating.d.ts.map +1 -1
- package/dist/s-rating/s-rating.js +31 -29
- package/dist/s-review/s-review.d.ts +6 -8
- package/dist/s-review/s-review.d.ts.map +1 -1
- package/dist/s-review/s-review.js +66 -153
- package/dist/s-scroll-to-top/s-scroll-to-top.d.ts +0 -2
- package/dist/s-scroll-to-top/s-scroll-to-top.d.ts.map +1 -1
- package/dist/s-scroll-to-top/s-scroll-to-top.js +17 -32
- package/dist/s-select/s-select.d.ts +1 -3
- package/dist/s-select/s-select.d.ts.map +1 -1
- package/dist/s-select/s-select.js +53 -93
- package/dist/s-select-list/s-select-list.d.ts +0 -2
- package/dist/s-select-list/s-select-list.d.ts.map +1 -1
- package/dist/s-select-list/s-select-list.js +24 -38
- package/dist/s-skeleton/index.d.ts +3 -0
- package/dist/s-skeleton/index.d.ts.map +1 -0
- package/dist/s-skeleton/index.js +1 -0
- package/dist/s-skeleton/s-skeleton.d.ts +27 -0
- package/dist/s-skeleton/s-skeleton.d.ts.map +1 -0
- package/dist/s-skeleton/s-skeleton.js +126 -0
- package/dist/s-switch/index.d.ts +3 -0
- package/dist/s-switch/index.d.ts.map +1 -0
- package/dist/s-switch/index.js +1 -0
- package/dist/s-switch/s-switch.d.ts +30 -0
- package/dist/s-switch/s-switch.d.ts.map +1 -0
- package/dist/s-switch/s-switch.js +44 -0
- package/dist/s-text-field/s-text-field.d.ts +0 -2
- package/dist/s-text-field/s-text-field.d.ts.map +1 -1
- package/dist/s-text-field/s-text-field.js +10 -23
- package/dist/s-text-shimmer/s-text-shimmer.d.ts +0 -14
- package/dist/s-text-shimmer/s-text-shimmer.d.ts.map +1 -1
- package/dist/s-text-shimmer/s-text-shimmer.js +28 -46
- package/dist/s-text-truncation/s-text-truncation.d.ts +4 -7
- package/dist/s-text-truncation/s-text-truncation.d.ts.map +1 -1
- package/dist/s-text-truncation/s-text-truncation.js +74 -34
- package/dist/s-tip/s-tip.d.ts +0 -1
- package/dist/s-tip/s-tip.d.ts.map +1 -1
- package/dist/s-tip/s-tip.js +9 -16
- package/dist/s-tooltip/index.d.ts +2 -0
- package/dist/s-tooltip/index.d.ts.map +1 -0
- package/dist/s-tooltip/index.js +1 -0
- package/dist/s-tooltip/s-tooltip.d.ts +23 -0
- package/dist/s-tooltip/s-tooltip.d.ts.map +1 -0
- package/dist/s-tooltip/s-tooltip.js +17 -0
- package/dist/s-zoom-image/s-zoom-image.d.ts +3 -5
- package/dist/s-zoom-image/s-zoom-image.d.ts.map +1 -1
- package/dist/s-zoom-image/s-zoom-image.js +16 -21
- package/dist/theme/theme-primitives.d.ts +10 -0
- package/dist/theme/theme-primitives.d.ts.map +1 -1
- package/dist/theme/theme-primitives.js +11 -0
- package/dist/utils/bytes-to-size.d.ts +0 -1
- package/dist/utils/bytes-to-size.d.ts.map +1 -1
- package/dist/utils/bytes-to-size.js +0 -1
- package/package.json +3 -2
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
-
import { Pressable,
|
|
4
|
-
import {
|
|
3
|
+
import { Pressable, View } from 'react-native';
|
|
4
|
+
import { Modal, Portal, TextInput } from 'react-native-paper';
|
|
5
5
|
import { SButton } from '../s-button';
|
|
6
|
-
import {
|
|
6
|
+
import { SIconButton } from '../s-icon-button';
|
|
7
|
+
import { SText } from '../s-text';
|
|
8
|
+
import { STextField } from '../s-text-field';
|
|
7
9
|
import { useSTheme } from '../theme';
|
|
8
10
|
/**
|
|
9
11
|
* A standardized date picker component that provides consistent form labeling and date selection.
|
|
10
|
-
* Synced with web SDatePicker from @solostylist/ui-kit.
|
|
11
12
|
*/
|
|
12
13
|
export const SDatePicker = ({ label, required = false, error, hint, value, onChange, placeholder = 'Select a date', disabled = false, minDate, maxDate, format = 'MM/DD/YYYY', size = 'medium', variant = 'outlined', }) => {
|
|
13
14
|
const { theme } = useSTheme();
|
|
@@ -104,117 +105,57 @@ export const SDatePicker = ({ label, required = false, error, hint, value, onCha
|
|
|
104
105
|
'December',
|
|
105
106
|
];
|
|
106
107
|
const dayNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
107
|
-
const styles = StyleSheet.create({
|
|
108
|
-
inputContainer: {
|
|
109
|
-
position: 'relative',
|
|
110
|
-
},
|
|
111
|
-
input: {
|
|
112
|
-
...(size === 'small'
|
|
113
|
-
? {
|
|
114
|
-
height: 36,
|
|
115
|
-
}
|
|
116
|
-
: {
|
|
117
|
-
height: 40,
|
|
118
|
-
}),
|
|
119
|
-
},
|
|
120
|
-
content: {
|
|
121
|
-
fontFamily: theme.typography.fontFamily,
|
|
122
|
-
fontSize: size === 'small' ? theme.typography.fontSize.sm : theme.typography.fontSize.md,
|
|
123
|
-
},
|
|
124
|
-
modalContainer: {
|
|
125
|
-
backgroundColor: theme.colors.background.paper,
|
|
126
|
-
margin: 20,
|
|
127
|
-
borderRadius: theme.borderRadius.lg,
|
|
128
|
-
padding: 20,
|
|
129
|
-
maxWidth: 400,
|
|
130
|
-
alignSelf: 'center',
|
|
131
|
-
width: '100%',
|
|
132
|
-
},
|
|
133
|
-
header: {
|
|
134
|
-
flexDirection: 'row',
|
|
135
|
-
justifyContent: 'space-between',
|
|
136
|
-
alignItems: 'center',
|
|
137
|
-
marginBottom: theme.spacing.lg,
|
|
138
|
-
},
|
|
139
|
-
monthYearText: {
|
|
140
|
-
fontSize: theme.typography.fontSize.lg,
|
|
141
|
-
fontFamily: theme.typography.fontFamily,
|
|
142
|
-
fontWeight: '600',
|
|
143
|
-
color: theme.colors.text.primary,
|
|
144
|
-
},
|
|
145
|
-
headerButtons: {
|
|
146
|
-
flexDirection: 'row',
|
|
147
|
-
gap: theme.spacing.xs,
|
|
148
|
-
},
|
|
149
|
-
weekRow: {
|
|
150
|
-
flexDirection: 'row',
|
|
151
|
-
justifyContent: 'space-around',
|
|
152
|
-
marginBottom: theme.spacing.sm,
|
|
153
|
-
},
|
|
154
|
-
dayNameText: {
|
|
155
|
-
width: 40,
|
|
156
|
-
textAlign: 'center',
|
|
157
|
-
fontSize: theme.typography.fontSize.sm,
|
|
158
|
-
fontFamily: theme.typography.fontFamily,
|
|
159
|
-
fontWeight: '600',
|
|
160
|
-
color: theme.colors.text.secondary,
|
|
161
|
-
},
|
|
162
|
-
calendarGrid: {
|
|
163
|
-
gap: 4,
|
|
164
|
-
},
|
|
165
|
-
calendarRow: {
|
|
166
|
-
flexDirection: 'row',
|
|
167
|
-
justifyContent: 'space-around',
|
|
168
|
-
},
|
|
169
|
-
dayButton: {
|
|
170
|
-
width: 40,
|
|
171
|
-
height: 40,
|
|
172
|
-
justifyContent: 'center',
|
|
173
|
-
alignItems: 'center',
|
|
174
|
-
borderRadius: theme.borderRadius.full,
|
|
175
|
-
},
|
|
176
|
-
dayButtonSelected: {
|
|
177
|
-
backgroundColor: theme.colors.primary[500],
|
|
178
|
-
},
|
|
179
|
-
dayButtonDisabled: {
|
|
180
|
-
opacity: 0.3,
|
|
181
|
-
},
|
|
182
|
-
dayText: {
|
|
183
|
-
fontSize: theme.typography.fontSize.sm,
|
|
184
|
-
fontFamily: theme.typography.fontFamily,
|
|
185
|
-
color: theme.colors.text.primary,
|
|
186
|
-
},
|
|
187
|
-
dayTextSelected: {
|
|
188
|
-
color: theme.colors.primary.contrastText,
|
|
189
|
-
fontWeight: '600',
|
|
190
|
-
},
|
|
191
|
-
dayTextDisabled: {
|
|
192
|
-
color: theme.colors.text.disabled,
|
|
193
|
-
},
|
|
194
|
-
footer: {
|
|
195
|
-
flexDirection: 'row',
|
|
196
|
-
justifyContent: 'flex-end',
|
|
197
|
-
gap: theme.spacing.sm,
|
|
198
|
-
marginTop: theme.spacing.lg,
|
|
199
|
-
},
|
|
200
|
-
});
|
|
201
108
|
const calendarDays = generateCalendarDays();
|
|
202
|
-
return (_jsxs(
|
|
109
|
+
return (_jsxs(View, { children: [_jsx(Pressable, { onPress: openPicker, disabled: disabled, children: _jsx(STextField, { label: label, hint: hint, error: error, required: required, variant: variant, placeholder: placeholder, value: formatDate(selectedDate), editable: false, disabled: disabled, size: size, right: _jsx(TextInput.Icon, { icon: selectedDate && !disabled ? 'close' : 'calendar', onPress: selectedDate && !disabled ? handleClear : openPicker, forceTextInputFocus: false, size: theme.iconSize.xs }), pointerEvents: "none" }) }), _jsx(Portal, { children: _jsxs(Modal, { visible: isPickerVisible, onDismiss: closePicker, contentContainerStyle: {
|
|
110
|
+
backgroundColor: theme.colors.background.paper,
|
|
111
|
+
margin: 20,
|
|
112
|
+
borderRadius: theme.borderRadius.lg,
|
|
113
|
+
padding: 20,
|
|
114
|
+
maxWidth: 400,
|
|
115
|
+
alignSelf: 'center',
|
|
116
|
+
width: '100%',
|
|
117
|
+
}, children: [_jsxs(View, { style: {
|
|
118
|
+
flexDirection: 'row',
|
|
119
|
+
justifyContent: 'space-between',
|
|
120
|
+
alignItems: 'center',
|
|
121
|
+
marginBottom: theme.spacing.lg,
|
|
122
|
+
}, children: [_jsx(SIconButton, { icon: "chevron-left", size: "medium", onPress: goToPreviousMonth }), _jsxs(SText, { variant: "subtitle2", children: [monthNames[currentMonth.getMonth()], " ", currentMonth.getFullYear()] }), _jsx(SIconButton, { icon: "chevron-right", size: "medium", onPress: goToNextMonth })] }), _jsx(View, { style: {
|
|
123
|
+
flexDirection: 'row',
|
|
124
|
+
marginBottom: theme.spacing.sm,
|
|
125
|
+
}, children: dayNames.map((day) => (_jsx(SText, { variant: "caption", style: {
|
|
126
|
+
width: '14.28%',
|
|
127
|
+
textAlign: 'center',
|
|
128
|
+
}, children: day }, day))) }), _jsx(View, { style: { gap: 4 }, children: Array.from({ length: Math.ceil(calendarDays.length / 7) }).map((_, weekIndex) => (_jsx(View, { style: { flexDirection: 'row' }, children: calendarDays.slice(weekIndex * 7, weekIndex * 7 + 7).map((date, dayIndex) => {
|
|
203
129
|
if (!date) {
|
|
204
|
-
return _jsx(View, { style:
|
|
130
|
+
return (_jsx(View, { style: {
|
|
131
|
+
width: '14.28%',
|
|
132
|
+
height: 40,
|
|
133
|
+
justifyContent: 'center',
|
|
134
|
+
alignItems: 'center',
|
|
135
|
+
} }, `empty-${dayIndex}`));
|
|
205
136
|
}
|
|
206
137
|
const isDisabled = isDateDisabled(date);
|
|
207
138
|
const isSelected = isDateSelected(date);
|
|
208
|
-
return (_jsx(Pressable, { onPress: () => !isDisabled && handleDateSelect(date), disabled: isDisabled, style:
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
139
|
+
return (_jsx(Pressable, { onPress: () => !isDisabled && handleDateSelect(date), disabled: isDisabled, style: {
|
|
140
|
+
width: '14.28%',
|
|
141
|
+
height: 40,
|
|
142
|
+
justifyContent: 'center',
|
|
143
|
+
alignItems: 'center',
|
|
144
|
+
...(isDisabled && { opacity: 0.3 }),
|
|
145
|
+
}, children: _jsx(View, { style: {
|
|
146
|
+
width: 36,
|
|
147
|
+
height: 36,
|
|
148
|
+
borderRadius: theme.borderRadius.full,
|
|
149
|
+
justifyContent: 'center',
|
|
150
|
+
alignItems: 'center',
|
|
151
|
+
...(isSelected && { backgroundColor: theme.colors.primary[500] }),
|
|
152
|
+
}, children: _jsx(SText, { children: date.getDate() }) }) }, date.toISOString()));
|
|
153
|
+
}) }, weekIndex))) }), _jsxs(View, { style: {
|
|
154
|
+
flexDirection: 'row',
|
|
155
|
+
justifyContent: 'flex-end',
|
|
156
|
+
gap: theme.spacing.sm,
|
|
157
|
+
marginTop: theme.spacing.lg,
|
|
158
|
+
}, children: [_jsx(SButton, { variant: "outlined", onPress: closePicker, children: "Cancel" }), _jsx(SButton, { onPress: () => selectedDate && handleDateSelect(selectedDate), children: "OK" })] })] }) })] }));
|
|
218
159
|
};
|
|
219
160
|
SDatePicker.displayName = 'SDatePicker';
|
|
220
161
|
export default SDatePicker;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* Props interface for SDateTimePicker component
|
|
4
|
-
* Synced with web SDateTimePicker from @solostylist/ui-kit
|
|
5
4
|
*/
|
|
6
5
|
export interface SDateTimePickerProps {
|
|
7
6
|
/** Field label displayed above the datetime picker */
|
|
@@ -39,7 +38,6 @@ export interface SDateTimePickerProps {
|
|
|
39
38
|
}
|
|
40
39
|
/**
|
|
41
40
|
* A standardized date and time picker component that provides consistent form labeling and datetime selection.
|
|
42
|
-
* Synced with web SDateTimePicker from @solostylist/ui-kit.
|
|
43
41
|
*/
|
|
44
42
|
export declare const SDateTimePicker: {
|
|
45
43
|
({ label, required, error, hint, value, onChange, placeholder, disabled, minDate, maxDate, format, timeFormat, size, variant, disableDate, disableTime, }: SDateTimePickerProps): React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"s-date-time-picker.d.ts","sourceRoot":"","sources":["../../src/s-date-time-picker/s-date-time-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"s-date-time-picker.d.ts","sourceRoot":"","sources":["../../src/s-date-time-picker/s-date-time-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AASxC;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,KAAK,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACpB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IAC3C,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8BAA8B;IAC9B,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,8BAA8B;IAC9B,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,qDAAqD;IACrD,MAAM,CAAC,EAAE,YAAY,GAAG,YAAY,GAAG,YAAY,CAAC;IACpD,8BAA8B;IAC9B,UAAU,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IAC3B,yBAAyB;IACzB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B,2BAA2B;IAC3B,OAAO,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;IAC9B,yCAAyC;IACzC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,yCAAyC;IACzC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;GAEG;AACH,eAAO,MAAM,eAAe;+JAiBzB,oBAAoB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO;;CAge1C,CAAC;AAIF,eAAe,eAAe,CAAC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
-
import { Pressable, ScrollView,
|
|
4
|
-
import {
|
|
3
|
+
import { Pressable, ScrollView, View } from 'react-native';
|
|
4
|
+
import { Modal, Portal, TextInput } from 'react-native-paper';
|
|
5
5
|
import { SButton } from '../s-button';
|
|
6
|
-
import {
|
|
6
|
+
import { SIconButton } from '../s-icon-button';
|
|
7
|
+
import { SText } from '../s-text';
|
|
8
|
+
import { STextField } from '../s-text-field';
|
|
7
9
|
import { useSTheme } from '../theme';
|
|
8
10
|
/**
|
|
9
11
|
* A standardized date and time picker component that provides consistent form labeling and datetime selection.
|
|
10
|
-
* Synced with web SDateTimePicker from @solostylist/ui-kit.
|
|
11
12
|
*/
|
|
12
13
|
export const SDateTimePicker = ({ label, required = false, error, hint, value, onChange, placeholder = 'Select date and time', disabled = false, minDate, maxDate, format = 'MM/DD/YYYY', timeFormat = '12h', size = 'medium', variant = 'outlined', disableDate = false, disableTime = false, }) => {
|
|
13
14
|
const { theme } = useSTheme();
|
|
@@ -175,216 +176,123 @@ export const SDateTimePicker = ({ label, required = false, error, hint, value, o
|
|
|
175
176
|
const handlePeriodToggle = () => {
|
|
176
177
|
setSelectedHour((prev) => (prev >= 12 ? prev - 12 : prev + 12));
|
|
177
178
|
};
|
|
178
|
-
const styles = StyleSheet.create({
|
|
179
|
-
inputContainer: {
|
|
180
|
-
position: 'relative',
|
|
181
|
-
},
|
|
182
|
-
input: {
|
|
183
|
-
...(size === 'small'
|
|
184
|
-
? {
|
|
185
|
-
height: 36,
|
|
186
|
-
}
|
|
187
|
-
: {
|
|
188
|
-
height: 40,
|
|
189
|
-
}),
|
|
190
|
-
},
|
|
191
|
-
content: {
|
|
192
|
-
fontFamily: theme.typography.fontFamily,
|
|
193
|
-
fontSize: size === 'small' ? theme.typography.fontSize.sm : theme.typography.fontSize.md,
|
|
194
|
-
},
|
|
195
|
-
modalContainer: {
|
|
196
|
-
backgroundColor: theme.colors.background.paper,
|
|
197
|
-
margin: 20,
|
|
198
|
-
borderRadius: theme.borderRadius.lg,
|
|
199
|
-
padding: 20,
|
|
200
|
-
maxWidth: 400,
|
|
201
|
-
alignSelf: 'center',
|
|
202
|
-
width: '100%',
|
|
203
|
-
maxHeight: '80%',
|
|
204
|
-
},
|
|
205
|
-
scrollContainer: {
|
|
206
|
-
flexGrow: 0,
|
|
207
|
-
},
|
|
208
|
-
header: {
|
|
209
|
-
flexDirection: 'row',
|
|
210
|
-
justifyContent: 'space-between',
|
|
211
|
-
alignItems: 'center',
|
|
212
|
-
marginBottom: theme.spacing.lg,
|
|
213
|
-
},
|
|
214
|
-
monthYearText: {
|
|
215
|
-
fontSize: theme.typography.fontSize.lg,
|
|
216
|
-
fontFamily: theme.typography.fontFamily,
|
|
217
|
-
fontWeight: '600',
|
|
218
|
-
color: theme.colors.text.primary,
|
|
219
|
-
},
|
|
220
|
-
headerButtons: {
|
|
221
|
-
flexDirection: 'row',
|
|
222
|
-
gap: theme.spacing.xs,
|
|
223
|
-
},
|
|
224
|
-
weekRow: {
|
|
225
|
-
flexDirection: 'row',
|
|
226
|
-
justifyContent: 'space-around',
|
|
227
|
-
marginBottom: theme.spacing.sm,
|
|
228
|
-
},
|
|
229
|
-
dayNameText: {
|
|
230
|
-
width: 40,
|
|
231
|
-
textAlign: 'center',
|
|
232
|
-
fontSize: theme.typography.fontSize.sm,
|
|
233
|
-
fontFamily: theme.typography.fontFamily,
|
|
234
|
-
fontWeight: '600',
|
|
235
|
-
color: theme.colors.text.secondary,
|
|
236
|
-
},
|
|
237
|
-
calendarGrid: {
|
|
238
|
-
gap: 4,
|
|
239
|
-
},
|
|
240
|
-
calendarRow: {
|
|
241
|
-
flexDirection: 'row',
|
|
242
|
-
justifyContent: 'space-around',
|
|
243
|
-
},
|
|
244
|
-
dayButton: {
|
|
245
|
-
width: 40,
|
|
246
|
-
height: 40,
|
|
247
|
-
justifyContent: 'center',
|
|
248
|
-
alignItems: 'center',
|
|
249
|
-
borderRadius: theme.borderRadius.full,
|
|
250
|
-
},
|
|
251
|
-
dayButtonSelected: {
|
|
252
|
-
backgroundColor: theme.colors.primary[500],
|
|
253
|
-
},
|
|
254
|
-
dayButtonDisabled: {
|
|
255
|
-
opacity: 0.3,
|
|
256
|
-
},
|
|
257
|
-
dayText: {
|
|
258
|
-
fontSize: theme.typography.fontSize.sm,
|
|
259
|
-
fontFamily: theme.typography.fontFamily,
|
|
260
|
-
color: theme.colors.text.primary,
|
|
261
|
-
},
|
|
262
|
-
dayTextSelected: {
|
|
263
|
-
color: theme.colors.primary.contrastText,
|
|
264
|
-
fontWeight: '600',
|
|
265
|
-
},
|
|
266
|
-
dayTextDisabled: {
|
|
267
|
-
color: theme.colors.text.disabled,
|
|
268
|
-
},
|
|
269
|
-
timeSection: {
|
|
270
|
-
marginTop: theme.spacing.lg,
|
|
271
|
-
paddingTop: theme.spacing.lg,
|
|
272
|
-
borderTopWidth: 1,
|
|
273
|
-
borderTopColor: theme.colors.divider,
|
|
274
|
-
},
|
|
275
|
-
timeSectionTitle: {
|
|
276
|
-
fontSize: theme.typography.fontSize.md,
|
|
277
|
-
fontFamily: theme.typography.fontFamily,
|
|
278
|
-
fontWeight: '600',
|
|
279
|
-
color: theme.colors.text.primary,
|
|
280
|
-
marginBottom: theme.spacing.md,
|
|
281
|
-
textAlign: 'center',
|
|
282
|
-
},
|
|
283
|
-
timePickerContainer: {
|
|
284
|
-
flexDirection: 'row',
|
|
285
|
-
justifyContent: 'center',
|
|
286
|
-
alignItems: 'center',
|
|
287
|
-
gap: theme.spacing.md,
|
|
288
|
-
},
|
|
289
|
-
timeColumn: {
|
|
290
|
-
alignItems: 'center',
|
|
291
|
-
},
|
|
292
|
-
timeScrollContainer: {
|
|
293
|
-
height: 120,
|
|
294
|
-
width: 60,
|
|
295
|
-
},
|
|
296
|
-
timeOption: {
|
|
297
|
-
height: 40,
|
|
298
|
-
justifyContent: 'center',
|
|
299
|
-
alignItems: 'center',
|
|
300
|
-
paddingHorizontal: theme.spacing.sm,
|
|
301
|
-
},
|
|
302
|
-
timeOptionSelected: {
|
|
303
|
-
backgroundColor: theme.colors.primary[500],
|
|
304
|
-
borderRadius: theme.borderRadius.md,
|
|
305
|
-
},
|
|
306
|
-
timeOptionText: {
|
|
307
|
-
fontSize: theme.typography.fontSize.md,
|
|
308
|
-
fontFamily: theme.typography.fontFamily,
|
|
309
|
-
color: theme.colors.text.primary,
|
|
310
|
-
},
|
|
311
|
-
timeOptionTextSelected: {
|
|
312
|
-
color: theme.colors.primary.contrastText,
|
|
313
|
-
fontWeight: '600',
|
|
314
|
-
},
|
|
315
|
-
timeLabel: {
|
|
316
|
-
fontSize: theme.typography.fontSize.xs,
|
|
317
|
-
fontFamily: theme.typography.fontFamily,
|
|
318
|
-
color: theme.colors.text.secondary,
|
|
319
|
-
marginBottom: theme.spacing.xs,
|
|
320
|
-
},
|
|
321
|
-
separator: {
|
|
322
|
-
fontSize: theme.typography.fontSize.xl,
|
|
323
|
-
fontFamily: theme.typography.fontFamily,
|
|
324
|
-
fontWeight: '600',
|
|
325
|
-
color: theme.colors.text.primary,
|
|
326
|
-
marginTop: theme.spacing.lg,
|
|
327
|
-
},
|
|
328
|
-
periodToggle: {
|
|
329
|
-
flexDirection: 'column',
|
|
330
|
-
gap: theme.spacing.xs,
|
|
331
|
-
},
|
|
332
|
-
periodButton: {
|
|
333
|
-
paddingVertical: theme.spacing.sm,
|
|
334
|
-
paddingHorizontal: theme.spacing.md,
|
|
335
|
-
borderRadius: theme.borderRadius.md,
|
|
336
|
-
borderWidth: 1,
|
|
337
|
-
borderColor: theme.colors.divider,
|
|
338
|
-
minWidth: 50,
|
|
339
|
-
alignItems: 'center',
|
|
340
|
-
},
|
|
341
|
-
periodButtonActive: {
|
|
342
|
-
backgroundColor: theme.colors.primary[500],
|
|
343
|
-
borderColor: theme.colors.primary[500],
|
|
344
|
-
},
|
|
345
|
-
periodButtonText: {
|
|
346
|
-
fontSize: theme.typography.fontSize.sm,
|
|
347
|
-
fontFamily: theme.typography.fontFamily,
|
|
348
|
-
color: theme.colors.text.primary,
|
|
349
|
-
fontWeight: '600',
|
|
350
|
-
},
|
|
351
|
-
periodButtonTextActive: {
|
|
352
|
-
color: theme.colors.primary.contrastText,
|
|
353
|
-
},
|
|
354
|
-
footer: {
|
|
355
|
-
flexDirection: 'row',
|
|
356
|
-
justifyContent: 'flex-end',
|
|
357
|
-
gap: theme.spacing.sm,
|
|
358
|
-
marginTop: theme.spacing.lg,
|
|
359
|
-
},
|
|
360
|
-
});
|
|
361
179
|
const calendarDays = generateCalendarDays();
|
|
362
180
|
const hourOptions = getHourOptions();
|
|
363
181
|
const minuteOptions = getMinuteOptions();
|
|
364
182
|
const displayHour = timeFormat === '12h' ? selectedHour % 12 || 12 : selectedHour;
|
|
365
183
|
const isPM = selectedHour >= 12;
|
|
366
|
-
return (_jsxs(
|
|
184
|
+
return (_jsxs(View, { children: [_jsx(Pressable, { onPress: openPicker, disabled: disabled, children: _jsx(STextField, { label: label, hint: hint, error: error, required: required, variant: variant, placeholder: placeholder, value: formatDateTime(selectedDateTime), editable: false, disabled: disabled, size: size, right: _jsx(TextInput.Icon, { icon: selectedDateTime && !disabled ? 'close' : 'calendar-clock', onPress: selectedDateTime && !disabled ? handleClear : openPicker, forceTextInputFocus: false, size: theme.iconSize.xs }), pointerEvents: "none" }) }), _jsx(Portal, { children: _jsxs(Modal, { visible: isPickerVisible, onDismiss: closePicker, contentContainerStyle: {
|
|
185
|
+
backgroundColor: theme.colors.background.paper,
|
|
186
|
+
margin: 20,
|
|
187
|
+
borderRadius: theme.borderRadius.lg,
|
|
188
|
+
padding: 20,
|
|
189
|
+
maxWidth: 400,
|
|
190
|
+
alignSelf: 'center',
|
|
191
|
+
width: '100%',
|
|
192
|
+
maxHeight: '80%',
|
|
193
|
+
}, children: [_jsxs(ScrollView, { style: { flexGrow: 0 }, showsVerticalScrollIndicator: false, children: [!disableDate && (_jsxs(_Fragment, { children: [_jsxs(View, { style: {
|
|
194
|
+
flexDirection: 'row',
|
|
195
|
+
justifyContent: 'space-between',
|
|
196
|
+
alignItems: 'center',
|
|
197
|
+
marginBottom: theme.spacing.lg,
|
|
198
|
+
}, children: [_jsx(SIconButton, { icon: "chevron-left", size: "medium", onPress: goToPreviousMonth }), _jsxs(SText, { variant: "subtitle2", children: [monthNames[currentMonth.getMonth()], " ", currentMonth.getFullYear()] }), _jsx(SIconButton, { icon: "chevron-right", size: "medium", onPress: goToNextMonth })] }), _jsx(View, { style: {
|
|
199
|
+
flexDirection: 'row',
|
|
200
|
+
marginBottom: theme.spacing.sm,
|
|
201
|
+
}, children: dayNames.map((day) => (_jsx(SText, { variant: "caption", style: {
|
|
202
|
+
width: '14.28%',
|
|
203
|
+
textAlign: 'center',
|
|
204
|
+
}, children: day }, day))) }), _jsx(View, { style: { gap: 4 }, children: Array.from({ length: Math.ceil(calendarDays.length / 7) }).map((_, weekIndex) => (_jsx(View, { style: { flexDirection: 'row' }, children: calendarDays.slice(weekIndex * 7, weekIndex * 7 + 7).map((date, dayIndex) => {
|
|
367
205
|
if (!date) {
|
|
368
|
-
return _jsx(View, { style:
|
|
206
|
+
return (_jsx(View, { style: {
|
|
207
|
+
width: '14.28%',
|
|
208
|
+
height: 40,
|
|
209
|
+
justifyContent: 'center',
|
|
210
|
+
alignItems: 'center',
|
|
211
|
+
} }, `empty-${dayIndex}`));
|
|
369
212
|
}
|
|
370
213
|
const isDisabled = isDateDisabled(date);
|
|
371
214
|
const isSelected = isDateSelected(date);
|
|
372
|
-
return (_jsx(Pressable, { onPress: () => !isDisabled && handleDateSelect(date), disabled: isDisabled, style:
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
215
|
+
return (_jsx(Pressable, { onPress: () => !isDisabled && handleDateSelect(date), disabled: isDisabled, style: {
|
|
216
|
+
width: '14.28%',
|
|
217
|
+
height: 40,
|
|
218
|
+
justifyContent: 'center',
|
|
219
|
+
alignItems: 'center',
|
|
220
|
+
...(isDisabled && { opacity: 0.3 }),
|
|
221
|
+
}, children: _jsx(View, { style: {
|
|
222
|
+
width: 36,
|
|
223
|
+
height: 36,
|
|
224
|
+
borderRadius: theme.borderRadius.full,
|
|
225
|
+
justifyContent: 'center',
|
|
226
|
+
alignItems: 'center',
|
|
227
|
+
...(isSelected && {
|
|
228
|
+
backgroundColor: theme.colors.primary[500],
|
|
229
|
+
}),
|
|
230
|
+
}, children: _jsx(SText, { children: date.getDate() }) }) }, date.toISOString()));
|
|
231
|
+
}) }, weekIndex))) })] })), !disableTime && (_jsxs(View, { style: {
|
|
232
|
+
marginTop: theme.spacing.lg,
|
|
233
|
+
paddingTop: theme.spacing.lg,
|
|
234
|
+
borderTopWidth: 1,
|
|
235
|
+
borderTopColor: theme.colors.divider,
|
|
236
|
+
}, children: [_jsx(SText, { variant: "subtitle2", style: {
|
|
237
|
+
marginBottom: theme.spacing.md,
|
|
238
|
+
textAlign: 'center',
|
|
239
|
+
}, children: "Select Time" }), _jsxs(View, { style: {
|
|
240
|
+
flexDirection: 'row',
|
|
241
|
+
justifyContent: 'center',
|
|
242
|
+
alignItems: 'flex-start',
|
|
243
|
+
gap: theme.spacing.md,
|
|
244
|
+
}, children: [_jsxs(View, { style: { alignItems: 'center' }, children: [_jsx(SText, { variant: "caption", children: "Hour" }), _jsx(ScrollView, { style: { height: 120, width: 60 }, showsVerticalScrollIndicator: false, children: hourOptions.map((hour) => {
|
|
382
245
|
const isSelected = hour === displayHour;
|
|
383
|
-
return (_jsx(Pressable, { onPress: () => handleHourChange(hour), style:
|
|
384
|
-
|
|
246
|
+
return (_jsx(Pressable, { onPress: () => handleHourChange(hour), style: {
|
|
247
|
+
height: 40,
|
|
248
|
+
justifyContent: 'center',
|
|
249
|
+
alignItems: 'center',
|
|
250
|
+
paddingHorizontal: theme.spacing.sm,
|
|
251
|
+
...(isSelected && {
|
|
252
|
+
backgroundColor: theme.colors.primary[500],
|
|
253
|
+
borderRadius: theme.borderRadius.md,
|
|
254
|
+
}),
|
|
255
|
+
}, children: _jsx(SText, { children: String(hour).padStart(2, '0') }) }, hour));
|
|
256
|
+
}) })] }), _jsxs(View, { style: { alignItems: 'center' }, children: [_jsx(SText, { variant: "caption", children: "Minute" }), _jsx(ScrollView, { style: { height: 120, width: 60 }, showsVerticalScrollIndicator: false, children: minuteOptions.map((minute) => {
|
|
385
257
|
const isSelected = minute === selectedMinute;
|
|
386
|
-
return (_jsx(Pressable, { onPress: () => setSelectedMinute(minute), style:
|
|
387
|
-
|
|
258
|
+
return (_jsx(Pressable, { onPress: () => setSelectedMinute(minute), style: {
|
|
259
|
+
height: 40,
|
|
260
|
+
justifyContent: 'center',
|
|
261
|
+
alignItems: 'center',
|
|
262
|
+
paddingHorizontal: theme.spacing.sm,
|
|
263
|
+
...(isSelected && {
|
|
264
|
+
backgroundColor: theme.colors.primary[500],
|
|
265
|
+
borderRadius: theme.borderRadius.md,
|
|
266
|
+
}),
|
|
267
|
+
}, children: _jsx(SText, { children: String(minute).padStart(2, '0') }) }, minute));
|
|
268
|
+
}) })] }), timeFormat === '12h' && (_jsxs(View, { style: { alignItems: 'center' }, children: [_jsx(SText, { variant: "caption", children: "Period" }), _jsxs(View, { style: { flexDirection: 'column', gap: theme.spacing.xs }, children: [_jsx(Pressable, { onPress: () => isPM && handlePeriodToggle(), style: {
|
|
269
|
+
paddingVertical: theme.spacing.sm,
|
|
270
|
+
paddingHorizontal: theme.spacing.md,
|
|
271
|
+
borderRadius: theme.borderRadius.md,
|
|
272
|
+
borderWidth: 1,
|
|
273
|
+
borderColor: !isPM ? theme.colors.primary[500] : theme.colors.divider,
|
|
274
|
+
minWidth: 50,
|
|
275
|
+
alignItems: 'center',
|
|
276
|
+
...(!isPM && {
|
|
277
|
+
backgroundColor: theme.colors.primary[500],
|
|
278
|
+
}),
|
|
279
|
+
}, children: _jsx(SText, { children: "AM" }) }), _jsx(Pressable, { onPress: () => !isPM && handlePeriodToggle(), style: {
|
|
280
|
+
paddingVertical: theme.spacing.sm,
|
|
281
|
+
paddingHorizontal: theme.spacing.md,
|
|
282
|
+
borderRadius: theme.borderRadius.md,
|
|
283
|
+
borderWidth: 1,
|
|
284
|
+
borderColor: isPM ? theme.colors.primary[500] : theme.colors.divider,
|
|
285
|
+
minWidth: 50,
|
|
286
|
+
alignItems: 'center',
|
|
287
|
+
...(isPM && {
|
|
288
|
+
backgroundColor: theme.colors.primary[500],
|
|
289
|
+
}),
|
|
290
|
+
}, children: _jsx(SText, { children: "PM" }) })] })] }))] })] }))] }), _jsxs(View, { style: {
|
|
291
|
+
flexDirection: 'row',
|
|
292
|
+
justifyContent: 'flex-end',
|
|
293
|
+
gap: theme.spacing.sm,
|
|
294
|
+
marginTop: theme.spacing.lg,
|
|
295
|
+
}, children: [_jsx(SButton, { variant: "outlined", onPress: closePicker, children: "Cancel" }), _jsx(SButton, { onPress: handleDateTimeSelect, children: "OK" })] })] }) })] }));
|
|
388
296
|
};
|
|
389
297
|
SDateTimePicker.displayName = 'SDateTimePicker';
|
|
390
298
|
export default SDateTimePicker;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/s-divider/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './s-divider';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
export interface SDividerProps {
|
|
4
|
+
/** Custom styles for the divider */
|
|
5
|
+
style?: StyleProp<ViewStyle>;
|
|
6
|
+
/** Custom color for the divider. Defaults to theme.colors.divider */
|
|
7
|
+
color?: string;
|
|
8
|
+
/** Thickness of the divider in pixels (default: 1) */
|
|
9
|
+
thickness?: number;
|
|
10
|
+
/** Orientation of the divider (default: 'horizontal') */
|
|
11
|
+
orientation?: 'horizontal' | 'vertical';
|
|
12
|
+
/** Margin applied around the divider (vertical for horizontal, horizontal for vertical) */
|
|
13
|
+
margin?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A divider component that creates a visual separation between content.
|
|
17
|
+
* Follows the SoloStylist theme design system.
|
|
18
|
+
*/
|
|
19
|
+
export declare const SDivider: {
|
|
20
|
+
({ style, color, thickness, orientation, margin, }: SDividerProps): React.JSX.Element;
|
|
21
|
+
displayName: string;
|
|
22
|
+
};
|
|
23
|
+
export default SDivider;
|
|
24
|
+
//# sourceMappingURL=s-divider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s-divider.d.ts","sourceRoot":"","sources":["../../src/s-divider/s-divider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpE,MAAM,WAAW,aAAa;IAC5B,oCAAoC;IACpC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC,2FAA2F;IAC3F,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ;wDAMlB,aAAa,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO;;CA0BnC,CAAC;AAIF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { useSTheme } from '../theme';
|
|
4
|
+
/**
|
|
5
|
+
* A divider component that creates a visual separation between content.
|
|
6
|
+
* Follows the SoloStylist theme design system.
|
|
7
|
+
*/
|
|
8
|
+
export const SDivider = ({ style, color, thickness = 1, orientation = 'horizontal', margin = 0, }) => {
|
|
9
|
+
const { theme } = useSTheme();
|
|
10
|
+
const isHorizontal = orientation === 'horizontal';
|
|
11
|
+
return (_jsx(View, { style: [
|
|
12
|
+
{
|
|
13
|
+
backgroundColor: color || theme.colors.divider,
|
|
14
|
+
},
|
|
15
|
+
isHorizontal
|
|
16
|
+
? {
|
|
17
|
+
height: thickness,
|
|
18
|
+
width: '100%',
|
|
19
|
+
marginVertical: margin,
|
|
20
|
+
}
|
|
21
|
+
: {
|
|
22
|
+
width: thickness,
|
|
23
|
+
height: '100%',
|
|
24
|
+
marginHorizontal: margin,
|
|
25
|
+
},
|
|
26
|
+
style,
|
|
27
|
+
] }));
|
|
28
|
+
};
|
|
29
|
+
SDivider.displayName = 'SDivider';
|
|
30
|
+
export default SDivider;
|