@rolster/react-components 18.24.10 → 18.25.0

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.
@@ -1433,30 +1433,43 @@
1433
1433
  } /*# sourceMappingURL=LabelSwitch.css.map */
1434
1434
 
1435
1435
  .rls-pagination {
1436
+ --pvt-dimension: var(--rlc-pagination-dimension, var(--rls-sizing-x16));
1437
+ --pvt-description-display: block;
1438
+ --pvt-count-display: none;
1436
1439
  position: relative;
1437
1440
  display: flex;
1438
- justify-content: center;
1439
1441
  width: 100%;
1442
+ column-gap: var(--rlc-pagination-column-gap, var(--rls-sizing-x4));
1443
+ justify-content: center;
1444
+ align-items: center;
1440
1445
  overflow: hidden;
1441
- height: var(--rls-sizing-x20);
1442
- padding: 0rem var(--rls-sizing-x6);
1446
+ height: var(
1447
+ --rlc-pagination-height,
1448
+ calc(var(--pvt-dimension) + var(--rls-sizing-x4))
1449
+ );
1450
+ padding: var(--rlc-pagination-padding, 0rem var(--rls-sizing-x6));
1443
1451
  box-sizing: border-box;
1444
1452
  }
1453
+ .rls-pagination__body {
1454
+ display: flex;
1455
+ width: auto;
1456
+ column-gap: var(--rls-sizing-x8);
1457
+ align-items: center;
1458
+ }
1445
1459
  .rls-pagination__pages {
1446
1460
  display: flex;
1447
- gap: var(--rls-sizing-x4);
1448
1461
  width: auto;
1449
- margin: 0rem var(--rls-sizing-x4);
1462
+ column-gap: var(--rls-sizing-x4);
1463
+ align-items: center;
1450
1464
  }
1451
1465
  .rls-pagination__page {
1452
1466
  background: var(--rls-app-color-200);
1453
1467
  color: var(--rls-app-color-900);
1454
1468
  cursor: default;
1455
- margin: auto 0rem;
1456
1469
  text-align: center;
1457
- width: var(--rls-sizing-x16);
1458
- height: var(--rls-sizing-x16);
1459
- line-height: var(--rls-sizing-x16);
1470
+ width: var(--pvt-dimension);
1471
+ height: var(--pvt-dimension);
1472
+ line-height: var(--pvt-dimension);
1460
1473
  border-radius: var(--rls-sizing-x2);
1461
1474
  font-size: var(--rls-body-font-size);
1462
1475
  letter-spacing: var(--rls-body-letter-spacing);
@@ -1470,26 +1483,31 @@
1470
1483
  color: var(--rls-app-color-050);
1471
1484
  }
1472
1485
  .rls-pagination__description {
1473
- color: var(--rls-app-color-900);
1474
- margin: 0rem var(--rls-sizing-x4);
1486
+ display: var(--pvt-description-display);
1475
1487
  width: auto;
1476
- height: var(--rls-sizing-x20);
1477
- line-height: var(--rls-sizing-x20);
1478
1488
  font-size: var(--rls-body-font-size);
1479
1489
  font-weight: var(--rls-font-weight-bold);
1480
1490
  letter-spacing: var(--rls-body-letter-spacing);
1491
+ color: var(--rls-app-color-900);
1492
+ }
1493
+ .rls-pagination__count {
1494
+ display: var(--pvt-count-display);
1495
+ font-size: var(--rls-body-font-size);
1496
+ font-weight: var(--rls-font-weight-bold);
1497
+ letter-spacing: var(--rls-body-letter-spacing);
1498
+ color: var(--rls-app-color-900);
1481
1499
  }
1482
1500
  .rls-pagination__actions {
1501
+ display: flex;
1483
1502
  width: auto;
1503
+ column-gap: var(--rls-sizing-x2);
1484
1504
  }
1485
1505
  .rls-pagination__action {
1506
+ --rlc-icon-dimension: calc(var(--pvt-dimension) - var(--rls-sizing-x4));
1486
1507
  background: none;
1487
1508
  outline: none;
1488
1509
  color: var(--rls-app-color-600);
1489
- height: var(--rls-sizing-x18);
1490
- width: var(--rls-sizing-x18);
1491
- padding: var(--rls-sizing-x3);
1492
- margin: var(--rls-sizing-x1) 0rem;
1510
+ padding: var(--rls-sizing-x2);
1493
1511
  }
1494
1512
  .rls-pagination__action:hover {
1495
1513
  color: var(--rls-theme-color-300);
@@ -1498,6 +1516,13 @@
1498
1516
  .rls-pagination__action:disabled {
1499
1517
  pointer-events: none;
1500
1518
  opacity: 0.5;
1519
+ }
1520
+ @media screen and (max-width: 640px) {
1521
+ .rls-pagination {
1522
+ --pvt-description-display: none;
1523
+ --pvt-count-display: block;
1524
+ padding: 0rem;
1525
+ }
1501
1526
  } /*# sourceMappingURL=Pagination.css.map */
1502
1527
 
1503
1528
  .rls-picker-day {
@@ -1938,6 +1963,7 @@
1938
1963
  .rls-bottom-sheet {
1939
1964
  --pvt-component-transform: translateY(100%);
1940
1965
  --pvt-component-height: 0rem;
1966
+ --pvt-component-max-height: 75%;
1941
1967
  --pvt-component-opacity: 0;
1942
1968
  --pvt-component-visibility: hidden;
1943
1969
  --pvt-backdrop-opacity: 0;
@@ -1965,7 +1991,7 @@
1965
1991
  bottom: 0px;
1966
1992
  width: 100%;
1967
1993
  max-width: 240rem;
1968
- max-height: 75%;
1994
+ max-height: var(--pvt-component-max-height);
1969
1995
  flex-direction: column;
1970
1996
  opacity: var(--pvt-component-opacity);
1971
1997
  visibility: var(--pvt-component-visibility);
@@ -1983,7 +2009,7 @@
1983
2009
  width: var(--rls-sizing-x24);
1984
2010
  height: var(--rls-sizing-x2);
1985
2011
  border-radius: var(--rls-sizing-x2);
1986
- background: var(--rls-app-color-600);
2012
+ background: var(--rls-app-color-300);
1987
2013
  margin: var(--rls-sizing-x3) auto;
1988
2014
  }
1989
2015
  .rls-bottom-sheet__backdrop {
@@ -1999,6 +2025,16 @@
1999
2025
  backdrop-filter: blur(2px);
2000
2026
  transition: opacity 120ms 0ms var(--rls-deceleration-curve),
2001
2027
  bottom 120ms 0ms var(--rls-deceleration-curve);
2028
+ }
2029
+ @media screen and (max-height: 960px) {
2030
+ .rls-bottom-sheet {
2031
+ --pvt-component-max-height: calc(100% - 48rem);
2032
+ }
2033
+ }
2034
+ @media screen and (max-height: 720px) {
2035
+ .rls-bottom-sheet {
2036
+ --pvt-component-max-height: calc(100% - 32rem);
2037
+ }
2002
2038
  } /*# sourceMappingURL=BottomSheet.css.map */
2003
2039
 
2004
2040
  .rls-card {
package/dist/es/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import require$$0, { useMemo, useCallback, useState, useRef, useEffect, createContext } from 'react';
2
- import { currencyFormat, itIsDefined, PartialSealed } from '@rolster/commons';
2
+ import { currencyFormat, valueIsDefined, PartialSealed } from '@rolster/commons';
3
3
  import { i18n, i18nSubscribe } from '@rolster/i18n';
4
4
  import { PaginationController, verifyDayPicker, createDayPicker, createDayRangePicker, verifyMonthPicker, createMonthPicker, monthLimitTemplate, createYearPicker, verifyYearPicker, ListCollection, locationListCanTop, navigationListFromInput, navigationListFromElement, createAutocompleteStore, dateOutRange, verifyDateRange, PickerListenerEvent } from '@rolster/components';
5
5
  import { DAY_LABELS, DateRange, normalizeMinTime, assignDayInDate, dateIsBefore, dateFormatTemplate, MONTH_NAMES, Month, assignYearInDate, assignMonthInDate } from '@rolster/dates';
@@ -2019,13 +2019,13 @@ function RlsPagination({ suggestions, count, filter, onPagination }) {
2019
2019
  const goLastPagination = useCallback(() => {
2020
2020
  refreshPagination(controller.current?.goLastPage());
2021
2021
  }, []);
2022
- return (jsxRuntimeExports.jsxs("div", { className: "rls-pagination", children: [jsxRuntimeExports.jsxs("div", { className: "rls-pagination__actions", children: [jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goFirstPagination, disabled: template?.firstPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrowhead-left" }) }), jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goPreviousPagination, disabled: template?.firstPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrow-ios-left" }) })] }), jsxRuntimeExports.jsx("div", { className: "rls-pagination__pages", children: template?.pages.map((page, index) => {
2023
- return (jsxRuntimeExports.jsx("div", { className: renderClassStatus('rls-pagination__page', {
2024
- active: page.active
2025
- }), onClick: () => {
2026
- goToPagination(page);
2027
- }, children: page.label }, index));
2028
- }) }), jsxRuntimeExports.jsx("div", { className: "rls-pagination__description", children: template?.description }), jsxRuntimeExports.jsxs("div", { className: "rls-pagination__actions", children: [jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goNextPagination, disabled: template?.lastPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrow-ios-right" }) }), jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goLastPagination, disabled: template?.lastPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrowhead-right" }) })] })] }));
2022
+ return (jsxRuntimeExports.jsxs("div", { className: "rls-pagination", children: [jsxRuntimeExports.jsxs("div", { className: "rls-pagination__actions", children: [jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goFirstPagination, disabled: template?.firstPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrowhead-left" }) }), jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goPreviousPagination, disabled: template?.firstPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrow-ios-left" }) })] }), jsxRuntimeExports.jsxs("div", { className: "rls-pagination__body", children: [jsxRuntimeExports.jsx("div", { className: "rls-pagination__pages", children: template?.pages.map((page, index) => {
2023
+ return (jsxRuntimeExports.jsx("div", { className: renderClassStatus('rls-pagination__page', {
2024
+ active: page.active
2025
+ }), onClick: () => {
2026
+ goToPagination(page);
2027
+ }, children: page.label }, index));
2028
+ }) }), jsxRuntimeExports.jsx("div", { className: "rls-pagination__description", children: template?.description }), jsxRuntimeExports.jsx("span", { className: "rls-pagination__count", children: suggestions.length })] }), jsxRuntimeExports.jsxs("div", { className: "rls-pagination__actions", children: [jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goNextPagination, disabled: template?.lastPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrow-ios-right" }) }), jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goLastPagination, disabled: template?.lastPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrowhead-right" }) })] })] }));
2029
2029
  }
2030
2030
 
2031
2031
  function RlsPickerDayHeaders() {
@@ -2179,7 +2179,7 @@ function RlsPickerMonthElement({ month, onSelect, disabled }) {
2179
2179
  });
2180
2180
  }, [month.disabled, month.focused, month.selected, disabled]);
2181
2181
  const onClick = useCallback(() => {
2182
- itIsDefined(month.value) &&
2182
+ valueIsDefined(month.value) &&
2183
2183
  !month.disabled &&
2184
2184
  !disabled &&
2185
2185
  onSelect(month.value);
@@ -2210,7 +2210,7 @@ function RlsPickerMonth({ date: _date, disabled, formControl, maxDate, minDate,
2210
2210
  maxDate
2211
2211
  };
2212
2212
  const month = verifyMonthPicker(options);
2213
- itIsDefined(month)
2213
+ valueIsDefined(month)
2214
2214
  ? setMonthValue(month)
2215
2215
  : setMonths(createMonthPicker(options));
2216
2216
  }, [date, year, value, minDate, maxDate]);
@@ -2222,7 +2222,7 @@ function RlsPickerMonth({ date: _date, disabled, formControl, maxDate, minDate,
2222
2222
  minDate,
2223
2223
  maxDate
2224
2224
  });
2225
- itIsDefined(month)
2225
+ valueIsDefined(month)
2226
2226
  ? formControl?.setValue(month)
2227
2227
  : setValue(formControl?.value ?? date.getMonth());
2228
2228
  }, [formControl?.value]);
@@ -2248,7 +2248,8 @@ function RlsPickerSelectorTitle({ monthControl, type, yearControl, date, disable
2248
2248
  setLabel(MONTH_NAMES(monthControl.value ?? Month.January));
2249
2249
  }, [monthControl.value]);
2250
2250
  const onPreviousMonth = useCallback(() => {
2251
- if (itIsDefined(monthControl.value) && itIsDefined(yearControl.value)) {
2251
+ if (valueIsDefined(monthControl.value) &&
2252
+ valueIsDefined(yearControl.value)) {
2252
2253
  if (monthControl.value > Month.January) {
2253
2254
  monthControl.setValue(monthControl.value - 1);
2254
2255
  }
@@ -2259,14 +2260,15 @@ function RlsPickerSelectorTitle({ monthControl, type, yearControl, date, disable
2259
2260
  }
2260
2261
  }, [monthControl.value, yearControl.value]);
2261
2262
  const onPreviousYear = useCallback(() => {
2262
- itIsDefined(yearControl.value) &&
2263
+ valueIsDefined(yearControl.value) &&
2263
2264
  yearControl.setValue(yearControl.value - 1);
2264
2265
  }, [yearControl.value]);
2265
2266
  const onPrevious = useCallback(() => {
2266
2267
  type === 'month' ? onPreviousMonth() : onPreviousYear();
2267
2268
  }, [type, onPreviousMonth, onPreviousYear]);
2268
2269
  const onNextMonth = useCallback(() => {
2269
- if (itIsDefined(monthControl.value) && itIsDefined(yearControl.value)) {
2270
+ if (valueIsDefined(monthControl.value) &&
2271
+ valueIsDefined(yearControl.value)) {
2270
2272
  if (monthControl.value < Month.December) {
2271
2273
  monthControl.setValue(monthControl.value + 1);
2272
2274
  }
@@ -2277,7 +2279,7 @@ function RlsPickerSelectorTitle({ monthControl, type, yearControl, date, disable
2277
2279
  }
2278
2280
  }, [monthControl.value, yearControl.value]);
2279
2281
  const onNextYear = useCallback(() => {
2280
- itIsDefined(yearControl.value) &&
2282
+ valueIsDefined(yearControl.value) &&
2281
2283
  yearControl.setValue(yearControl.value + 1);
2282
2284
  }, [yearControl.value]);
2283
2285
  const onNext = useCallback(() => {
@@ -2331,7 +2333,7 @@ function RlsPickerYear({ date: _date, disabled, formControl, maxDate, minDate, o
2331
2333
  }, [template.years, onSelect, disabled]);
2332
2334
  useEffect(() => {
2333
2335
  const year = verifyYearPicker(createPickerOptions());
2334
- itIsDefined(year)
2336
+ valueIsDefined(year)
2335
2337
  ? formControl?.setValue(year)
2336
2338
  : setValue(formControl?.value ?? date.getFullYear());
2337
2339
  }, [formControl?.value]);
@@ -3038,14 +3040,14 @@ function RlsPickerDateRange({ automatic, date: _picker, disabled, formControl, m
3038
3040
  }, []);
3039
3041
  useEffect(() => {
3040
3042
  setDate((date) => {
3041
- return itIsDefined(yearControl.value)
3043
+ return valueIsDefined(yearControl.value)
3042
3044
  ? assignYearInDate(date, yearControl.value)
3043
3045
  : date;
3044
3046
  });
3045
3047
  }, [yearControl.value]);
3046
3048
  useEffect(() => {
3047
3049
  setDate((date) => {
3048
- return itIsDefined(monthControl.value)
3050
+ return valueIsDefined(monthControl.value)
3049
3051
  ? assignMonthInDate(date, monthControl.value)
3050
3052
  : date;
3051
3053
  });