@scripso-homepad/ui 0.4.9 → 0.4.10
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/index.cjs +123 -84
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +123 -84
- package/dist/index.js.map +1 -1
- package/dist/web/index.cjs +413 -22
- package/dist/web/index.cjs.map +1 -1
- package/dist/web/index.css +161 -0
- package/dist/web/index.css.map +1 -1
- package/dist/web/index.d.cts +48 -1
- package/dist/web/index.d.ts +48 -1
- package/dist/web/index.js +406 -23
- package/dist/web/index.js.map +1 -1
- package/package.json +9 -3
- package/src/components/DatePicker.tsx +37 -3
- package/src/web/components/Drawer.stories.tsx +234 -0
- package/src/web/components/Drawer.tsx +169 -0
- package/src/web/components/HistoryTimeline.tsx +46 -0
- package/src/web/components/Modal.tsx +5 -5
- package/src/web/components/TableActionButton.tsx +3 -3
- package/src/web/components/Toaster.stories.tsx +106 -0
- package/src/web/components/Toaster.tsx +92 -0
- package/src/web/components/ToasterProvider.tsx +6 -0
- package/src/web/components/drawer-scroll.css +41 -0
- package/src/web/components/sonner-toast.css +141 -0
- package/src/web/icons/TimelineCheckIcon.tsx +24 -0
- package/src/web/icons/ToastIcons.tsx +119 -0
- package/src/web/index.ts +20 -0
- package/src/web/mutation-toast.ts +33 -0
- package/src/web/toast.ts +1 -0
package/dist/index.d.cts
CHANGED
|
@@ -191,6 +191,8 @@ type DatePickerFieldProps = {
|
|
|
191
191
|
containerStyle?: StyleProp<ViewStyle>;
|
|
192
192
|
className?: string;
|
|
193
193
|
fieldClassName?: string;
|
|
194
|
+
fieldStyle?: StyleProp<ViewStyle>;
|
|
195
|
+
fieldOutlineStyle?: StyleProp<ViewStyle>;
|
|
194
196
|
panelClassName?: string;
|
|
195
197
|
labelClassName?: string;
|
|
196
198
|
errorClassName?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -191,6 +191,8 @@ type DatePickerFieldProps = {
|
|
|
191
191
|
containerStyle?: StyleProp<ViewStyle>;
|
|
192
192
|
className?: string;
|
|
193
193
|
fieldClassName?: string;
|
|
194
|
+
fieldStyle?: StyleProp<ViewStyle>;
|
|
195
|
+
fieldOutlineStyle?: StyleProp<ViewStyle>;
|
|
194
196
|
panelClassName?: string;
|
|
195
197
|
labelClassName?: string;
|
|
196
198
|
errorClassName?: string;
|
package/dist/index.js
CHANGED
|
@@ -2172,6 +2172,8 @@ function DatePicker(props) {
|
|
|
2172
2172
|
containerStyle,
|
|
2173
2173
|
className,
|
|
2174
2174
|
fieldClassName,
|
|
2175
|
+
fieldStyle,
|
|
2176
|
+
fieldOutlineStyle,
|
|
2175
2177
|
panelClassName,
|
|
2176
2178
|
labelClassName,
|
|
2177
2179
|
errorClassName,
|
|
@@ -2265,96 +2267,120 @@ function DatePicker(props) {
|
|
|
2265
2267
|
closePicker();
|
|
2266
2268
|
}
|
|
2267
2269
|
}
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2270
|
+
const isFluidField = Boolean(fieldStyle) || Boolean(fieldOutlineStyle);
|
|
2271
|
+
return /* @__PURE__ */ jsxs(
|
|
2272
|
+
View,
|
|
2273
|
+
{
|
|
2274
|
+
ref: wrapperRef,
|
|
2275
|
+
style: [styles4.wrapper, isFluidField && styles4.wrapperFluid, containerStyle],
|
|
2276
|
+
children: [
|
|
2277
|
+
label ? /* @__PURE__ */ jsx(Label, { disabled, style: styles4.label, className: labelClassName, children: label }) : null,
|
|
2278
|
+
/* @__PURE__ */ jsx(
|
|
2279
|
+
View,
|
|
2280
|
+
{
|
|
2281
|
+
style: [
|
|
2282
|
+
fieldStyles.outline,
|
|
2283
|
+
styles4.fieldOutline,
|
|
2284
|
+
isFluidField && styles4.fieldOutlineFluid,
|
|
2285
|
+
fieldOutlineStyle
|
|
2286
|
+
],
|
|
2287
|
+
children: /* @__PURE__ */ jsxs(
|
|
2288
|
+
Pressable,
|
|
2289
|
+
{
|
|
2290
|
+
ref: triggerRef,
|
|
2291
|
+
accessibilityRole: "button",
|
|
2292
|
+
accessibilityState: { disabled, expanded: open },
|
|
2293
|
+
disabled,
|
|
2294
|
+
onPress: openPicker,
|
|
2295
|
+
style: [
|
|
2296
|
+
calendarFieldMetrics.container,
|
|
2297
|
+
isFluidField && styles4.fieldContainerFluid,
|
|
2298
|
+
fieldStyles.container,
|
|
2299
|
+
fieldStyle
|
|
2300
|
+
],
|
|
2301
|
+
children: [
|
|
2302
|
+
/* @__PURE__ */ jsx(
|
|
2303
|
+
Text,
|
|
2304
|
+
{
|
|
2305
|
+
style: [calendarFieldMetrics.value, valueTextStyle],
|
|
2306
|
+
numberOfLines: 1,
|
|
2307
|
+
children: displayValue
|
|
2308
|
+
}
|
|
2309
|
+
),
|
|
2310
|
+
/* @__PURE__ */ jsx(View, { style: styles4.iconSlot, children: /* @__PURE__ */ jsx(
|
|
2311
|
+
CalendarIcon,
|
|
2312
|
+
{
|
|
2313
|
+
size: CALENDAR_FIELD_ICON_SIZE,
|
|
2314
|
+
color: disabled ? colors.stormGray200 : colors.stormGray150
|
|
2315
|
+
}
|
|
2316
|
+
) })
|
|
2317
|
+
]
|
|
2318
|
+
}
|
|
2319
|
+
)
|
|
2320
|
+
}
|
|
2321
|
+
),
|
|
2322
|
+
helperMessage ? /* @__PURE__ */ jsx(Text, { ref: helperRef, style: error ? styles4.error : styles4.hint, children: helperMessage }) : null,
|
|
2323
|
+
/* @__PURE__ */ jsx(Modal, { visible: open, transparent: true, animationType: "fade", onRequestClose: closePicker, children: /* @__PURE__ */ jsxs(View, { style: styles4.modalRoot, children: [
|
|
2280
2324
|
/* @__PURE__ */ jsx(
|
|
2281
|
-
|
|
2325
|
+
Pressable,
|
|
2282
2326
|
{
|
|
2283
|
-
style:
|
|
2284
|
-
|
|
2285
|
-
|
|
2327
|
+
style: styles4.backdrop,
|
|
2328
|
+
onPress: closePicker,
|
|
2329
|
+
accessibilityRole: "button",
|
|
2330
|
+
accessibilityLabel: labels?.closeCalendar ?? translations.closeCalendar
|
|
2286
2331
|
}
|
|
2287
2332
|
),
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
{
|
|
2291
|
-
size: CALENDAR_FIELD_ICON_SIZE,
|
|
2292
|
-
color: disabled ? colors.stormGray200 : colors.stormGray150
|
|
2293
|
-
}
|
|
2294
|
-
) })
|
|
2295
|
-
]
|
|
2296
|
-
}
|
|
2297
|
-
) }),
|
|
2298
|
-
helperMessage ? /* @__PURE__ */ jsx(Text, { ref: helperRef, style: error ? styles4.error : styles4.hint, children: helperMessage }) : null,
|
|
2299
|
-
/* @__PURE__ */ jsx(Modal, { visible: open, transparent: true, animationType: "fade", onRequestClose: closePicker, children: /* @__PURE__ */ jsxs(View, { style: styles4.modalRoot, children: [
|
|
2300
|
-
/* @__PURE__ */ jsx(
|
|
2301
|
-
Pressable,
|
|
2302
|
-
{
|
|
2303
|
-
style: styles4.backdrop,
|
|
2304
|
-
onPress: closePicker,
|
|
2305
|
-
accessibilityRole: "button",
|
|
2306
|
-
accessibilityLabel: labels?.closeCalendar ?? translations.closeCalendar
|
|
2307
|
-
}
|
|
2308
|
-
),
|
|
2309
|
-
anchor ? /* @__PURE__ */ jsx(
|
|
2310
|
-
View,
|
|
2311
|
-
{
|
|
2312
|
-
style: [
|
|
2313
|
-
styles4.panelPosition,
|
|
2314
|
-
{
|
|
2315
|
-
top: dropdownTop,
|
|
2316
|
-
left: panelLeft,
|
|
2317
|
-
width: panelWidth,
|
|
2318
|
-
height: CALENDAR_PANEL_HEIGHT
|
|
2319
|
-
}
|
|
2320
|
-
],
|
|
2321
|
-
children: props.mode === "range" ? /* @__PURE__ */ jsx(
|
|
2322
|
-
Calendar,
|
|
2323
|
-
{
|
|
2324
|
-
mode: "range",
|
|
2325
|
-
value: props.value,
|
|
2326
|
-
onChange: handleRangeSelect,
|
|
2327
|
-
viewDate,
|
|
2328
|
-
defaultViewDate: resolvedDefaultViewDate,
|
|
2329
|
-
onViewDateChange,
|
|
2330
|
-
locale: resolvedLocale,
|
|
2331
|
-
labels,
|
|
2332
|
-
minDate,
|
|
2333
|
-
maxDate,
|
|
2334
|
-
today,
|
|
2335
|
-
className: panelClassName
|
|
2336
|
-
}
|
|
2337
|
-
) : /* @__PURE__ */ jsx(
|
|
2338
|
-
Calendar,
|
|
2333
|
+
anchor ? /* @__PURE__ */ jsx(
|
|
2334
|
+
View,
|
|
2339
2335
|
{
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2336
|
+
style: [
|
|
2337
|
+
styles4.panelPosition,
|
|
2338
|
+
{
|
|
2339
|
+
top: dropdownTop,
|
|
2340
|
+
left: panelLeft,
|
|
2341
|
+
width: panelWidth,
|
|
2342
|
+
height: CALENDAR_PANEL_HEIGHT
|
|
2343
|
+
}
|
|
2344
|
+
],
|
|
2345
|
+
children: props.mode === "range" ? /* @__PURE__ */ jsx(
|
|
2346
|
+
Calendar,
|
|
2347
|
+
{
|
|
2348
|
+
mode: "range",
|
|
2349
|
+
value: props.value,
|
|
2350
|
+
onChange: handleRangeSelect,
|
|
2351
|
+
viewDate,
|
|
2352
|
+
defaultViewDate: resolvedDefaultViewDate,
|
|
2353
|
+
onViewDateChange,
|
|
2354
|
+
locale: resolvedLocale,
|
|
2355
|
+
labels,
|
|
2356
|
+
minDate,
|
|
2357
|
+
maxDate,
|
|
2358
|
+
today,
|
|
2359
|
+
className: panelClassName
|
|
2360
|
+
}
|
|
2361
|
+
) : /* @__PURE__ */ jsx(
|
|
2362
|
+
Calendar,
|
|
2363
|
+
{
|
|
2364
|
+
mode: "single",
|
|
2365
|
+
value: props.value,
|
|
2366
|
+
onChange: handleSingleSelect,
|
|
2367
|
+
viewDate,
|
|
2368
|
+
defaultViewDate: resolvedDefaultViewDate,
|
|
2369
|
+
onViewDateChange,
|
|
2370
|
+
locale: resolvedLocale,
|
|
2371
|
+
labels,
|
|
2372
|
+
minDate,
|
|
2373
|
+
maxDate,
|
|
2374
|
+
today,
|
|
2375
|
+
className: panelClassName
|
|
2376
|
+
}
|
|
2377
|
+
)
|
|
2352
2378
|
}
|
|
2353
|
-
)
|
|
2354
|
-
}
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2379
|
+
) : null
|
|
2380
|
+
] }) })
|
|
2381
|
+
]
|
|
2382
|
+
}
|
|
2383
|
+
);
|
|
2358
2384
|
}
|
|
2359
2385
|
var styles4 = StyleSheet.create({
|
|
2360
2386
|
wrapper: {
|
|
@@ -2362,11 +2388,24 @@ var styles4 = StyleSheet.create({
|
|
|
2362
2388
|
maxWidth: "100%",
|
|
2363
2389
|
gap: SELECT_LABEL_GAP
|
|
2364
2390
|
},
|
|
2391
|
+
wrapperFluid: {
|
|
2392
|
+
width: "100%"
|
|
2393
|
+
},
|
|
2365
2394
|
fieldOutline: {
|
|
2366
2395
|
width: CALENDAR_FIELD_WIDTH,
|
|
2367
2396
|
maxWidth: "100%",
|
|
2368
2397
|
alignSelf: "flex-start"
|
|
2369
2398
|
},
|
|
2399
|
+
fieldOutlineFluid: {
|
|
2400
|
+
width: "100%",
|
|
2401
|
+
alignSelf: "stretch"
|
|
2402
|
+
},
|
|
2403
|
+
fieldContainerFluid: {
|
|
2404
|
+
width: "100%",
|
|
2405
|
+
minWidth: 0,
|
|
2406
|
+
maxWidth: "100%",
|
|
2407
|
+
alignSelf: "stretch"
|
|
2408
|
+
},
|
|
2370
2409
|
label: {
|
|
2371
2410
|
...calendarLabelTypography
|
|
2372
2411
|
},
|