@rolster/react-components 18.26.10 → 18.26.12
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/cjs/assets/{index-CwYV1zJh.css → index-C8NwFlLS.css} +41 -3
- package/dist/cjs/index.js +32 -14
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/assets/{index-CwYV1zJh.css → index-C8NwFlLS.css} +41 -3
- package/dist/es/index.js +33 -16
- package/dist/es/index.js.map +1 -1
- package/dist/esm/components/atoms/Badge/Badge.css +1 -1
- package/dist/esm/components/atoms/Badge/Badge.css.map +1 -1
- package/dist/esm/components/atoms/ButtonAction/ButtonAction.css +2 -1
- package/dist/esm/components/atoms/ButtonAction/ButtonAction.css.map +1 -1
- package/dist/esm/components/atoms/ButtonOption/ButtonOption.css +36 -0
- package/dist/esm/components/atoms/ButtonOption/ButtonOption.css.map +1 -0
- package/dist/esm/components/atoms/ButtonOption/ButtonOption.d.ts +19 -0
- package/dist/esm/components/atoms/ButtonOption/ButtonOption.js +23 -0
- package/dist/esm/components/atoms/ButtonOption/ButtonOption.js.map +1 -0
- package/dist/esm/components/molecules/LabelRadioButton/LabelRadioButton.d.ts +2 -2
- package/dist/esm/components/molecules/Slider/Slider.css +1 -1
- package/dist/esm/components/molecules/Slider/Slider.css.map +1 -1
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.d.ts +8 -8
- package/dist/esm/components/organisms/FieldDate/FieldDate.d.ts +8 -8
- package/dist/esm/components/organisms/FieldDateRange/FieldDateRange.d.ts +8 -8
- package/dist/esm/components/organisms/FieldDateRange/FieldDateRange.js.map +1 -1
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.d.ts +9 -9
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
);
|
|
113
113
|
color: var(--rls-theme-color-050);
|
|
114
114
|
background: var(--rls-theme-color-500);
|
|
115
|
-
border-radius: calc(var(--pvt-dimension) / 2);
|
|
115
|
+
border-radius: var(--rlc-badge-border-radius, calc(var(--pvt-dimension) / 2));
|
|
116
116
|
}
|
|
117
117
|
.rls-badge--contrast {
|
|
118
118
|
background: var(--rls-theme-color-100);
|
|
@@ -517,8 +517,9 @@
|
|
|
517
517
|
box-sizing: border-box;
|
|
518
518
|
user-select: none;
|
|
519
519
|
cursor: default;
|
|
520
|
-
|
|
520
|
+
border-radius: var(--rlc-action-radius, 50%);
|
|
521
521
|
color: var(--rlc-action-color, var(--rls-app-color-600));
|
|
522
|
+
background: var(--rlc-action-background, transparent);
|
|
522
523
|
}
|
|
523
524
|
.rls-button-action::before {
|
|
524
525
|
position: absolute;
|
|
@@ -598,6 +599,43 @@
|
|
|
598
599
|
}
|
|
599
600
|
} /*# sourceMappingURL=ButtonAction.css.map */
|
|
600
601
|
|
|
602
|
+
.rls-button-option {
|
|
603
|
+
--pvt-span-color: var(--rls-app-color-800);
|
|
604
|
+
--pvt-background-hover: var(--rls-theme-color-100);
|
|
605
|
+
--rlc-icon-color: var(--rls-app-color-600);
|
|
606
|
+
display: flex;
|
|
607
|
+
width: var(--rlc-button-option, auto);
|
|
608
|
+
flex-direction: column;
|
|
609
|
+
row-gap: var(--rls-sizing-x3);
|
|
610
|
+
align-items: center;
|
|
611
|
+
padding: var(--rls-sizing-x4) var(--rls-sizing-x3);
|
|
612
|
+
box-sizing: border-box;
|
|
613
|
+
outline: none;
|
|
614
|
+
background: rgba(0, 0, 0, 0);
|
|
615
|
+
border: var(--rls-app-border-1-300);
|
|
616
|
+
border-radius: var(--rls-sizing-x4);
|
|
617
|
+
overflow: hidden;
|
|
618
|
+
}
|
|
619
|
+
.rls-button-option:not(:disabled):hover {
|
|
620
|
+
background: var(--pvt-background-hover);
|
|
621
|
+
}
|
|
622
|
+
.rls-button-option:disabled {
|
|
623
|
+
opacity: 0.5;
|
|
624
|
+
}
|
|
625
|
+
.rls-button-option--checked {
|
|
626
|
+
--pvt-background-hover: var(--rls-theme-color-800);
|
|
627
|
+
--pvt-span-color: var(--rls-theme-color-050);
|
|
628
|
+
--rlc-icon-color: var(--rls-theme-color-050);
|
|
629
|
+
background: var(--rls-theme-gradient-500);
|
|
630
|
+
border: var(--rls-theme-border-1-500);
|
|
631
|
+
}
|
|
632
|
+
.rls-button-option > span {
|
|
633
|
+
font-size: var(--rls-span-font-size);
|
|
634
|
+
letter-spacing: var(--rls-span-letter-spacing);
|
|
635
|
+
color: var(--pvt-span-color);
|
|
636
|
+
font-weight: var(--rls-font-weight-medium);
|
|
637
|
+
} /*# sourceMappingURL=ButtonOption.css.map */
|
|
638
|
+
|
|
601
639
|
.rls-checkbox {
|
|
602
640
|
--rlc-icon-dimension: var(--rls-sizing-x10);
|
|
603
641
|
--rlc-icon-color: transparent;
|
|
@@ -2090,7 +2128,7 @@
|
|
|
2090
2128
|
height: var(--rls-sizing-x10);
|
|
2091
2129
|
line-height: var(--rls-sizing-x10);
|
|
2092
2130
|
text-align: center;
|
|
2093
|
-
font-size: var(--rls-
|
|
2131
|
+
font-size: var(--rls-tiny-font-size);
|
|
2094
2132
|
font-weight: var(--rls-font-weight-medium);
|
|
2095
2133
|
color: var(--pvt-thumb-color);
|
|
2096
2134
|
z-index: var(--rls-z-index-4);
|
package/dist/es/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import require$$0, { useMemo,
|
|
1
|
+
import require$$0, { useMemo, useState, useEffect, useCallback, useRef, createContext } from 'react';
|
|
2
2
|
import { currencyFormat, BigDecimal, valueIsDefined, SealedPartial } 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';
|
|
@@ -1437,6 +1437,37 @@ function RlsButtonAction({ icon, disabled, identifier, onClick, tooltip }) {
|
|
|
1437
1437
|
return (jsxRuntimeExports.jsxs("button", { id: identifier, className: "rls-button-action", onClick: onClick, disabled: disabled, children: [jsxRuntimeExports.jsx("div", { className: "rls-button-action__content", children: jsxRuntimeExports.jsx(RlsIcon, { value: icon }) }), tooltip && (jsxRuntimeExports.jsx("div", { className: "rls-button-action__tooltip rls-overline-medium", children: jsxRuntimeExports.jsx("span", { children: tooltip }) }))] }));
|
|
1438
1438
|
}
|
|
1439
1439
|
|
|
1440
|
+
function useFormSingleSelectionController({ disabled, formControl, onValue, value }) {
|
|
1441
|
+
const [checked, setChecked] = useState(formControl?.value === value);
|
|
1442
|
+
useEffect(() => {
|
|
1443
|
+
setChecked(formControl?.value === value);
|
|
1444
|
+
}, [formControl?.value]);
|
|
1445
|
+
const onSelect = useCallback(() => {
|
|
1446
|
+
if (!disabled) {
|
|
1447
|
+
formControl && formControl.setValue(value);
|
|
1448
|
+
onValue && onValue(value);
|
|
1449
|
+
}
|
|
1450
|
+
}, [formControl, value, onValue, disabled]);
|
|
1451
|
+
return { checked, onSelect };
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
function RlsButtonOption({ icon, children, disabled, formControl, identifier, onClick, onValue, value }) {
|
|
1455
|
+
const { checked, onSelect } = useFormSingleSelectionController({
|
|
1456
|
+
disabled,
|
|
1457
|
+
formControl,
|
|
1458
|
+
onValue,
|
|
1459
|
+
value
|
|
1460
|
+
});
|
|
1461
|
+
const className = useMemo(() => {
|
|
1462
|
+
return renderClassStatus('rls-button-option', { checked });
|
|
1463
|
+
}, [checked]);
|
|
1464
|
+
const onAction = useCallback(() => {
|
|
1465
|
+
onSelect();
|
|
1466
|
+
onClick && onClick();
|
|
1467
|
+
}, [onSelect, onClick]);
|
|
1468
|
+
return (jsxRuntimeExports.jsxs("button", { id: identifier, className: className, onClick: onAction, disabled: disabled, children: [jsxRuntimeExports.jsx(RlsIcon, { value: icon }), children] }));
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1440
1471
|
function RlsCheckBox({ checked, disabled, identifier, onClick, rlsTheme }) {
|
|
1441
1472
|
const className = useMemo(() => {
|
|
1442
1473
|
return renderClassStatus('rls-checkbox', { checked, disabled });
|
|
@@ -1983,20 +2014,6 @@ function RlsLabelCheckBox({ children, disabled, extended, identifier, formContro
|
|
|
1983
2014
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-label-checkbox__component", onClick: onToggle, children: jsxRuntimeExports.jsx(RlsCheckBox, { checked: checked, disabled: disabled }) }), jsxRuntimeExports.jsx("div", { className: "rls-label-checkbox__text", children: children })] }));
|
|
1984
2015
|
}
|
|
1985
2016
|
|
|
1986
|
-
function useFormSingleSelectionController({ disabled, formControl, onValue, value }) {
|
|
1987
|
-
const [checked, setChecked] = useState(formControl?.value === value);
|
|
1988
|
-
useEffect(() => {
|
|
1989
|
-
setChecked(formControl?.value === value);
|
|
1990
|
-
}, [formControl?.value]);
|
|
1991
|
-
const onSelect = useCallback(() => {
|
|
1992
|
-
if (!disabled) {
|
|
1993
|
-
formControl && formControl.setValue(value);
|
|
1994
|
-
onValue && onValue(value);
|
|
1995
|
-
}
|
|
1996
|
-
}, [formControl, value, onValue, disabled]);
|
|
1997
|
-
return { checked, onSelect };
|
|
1998
|
-
}
|
|
1999
|
-
|
|
2000
2017
|
function RlsLabelRadioButton({ children, disabled, extended, identifier, formControl, onValue, reverse, rlsTheme, value }) {
|
|
2001
2018
|
const { checked, onSelect } = useFormSingleSelectionController({
|
|
2002
2019
|
disabled,
|
|
@@ -3901,5 +3918,5 @@ function useDatatable() {
|
|
|
3901
3918
|
return { scrolleable, tableRef };
|
|
3902
3919
|
}
|
|
3903
3920
|
|
|
3904
|
-
export { ConfirmationResult, RlsAlert, RlsAmount, RlsApplication, RlsAvatar, RlsBadge, RlsBallot, RlsBottomSheet, RlsBreadcrumb, RlsButton, RlsButtonAction, RlsButtonProgress, RlsButtonToggle, RlsCard, RlsCheckBox, RlsCheckBoxControl, RlsConfirmation, RlsContent, RlsContext, RlsDatatable, RlsDatatableCell, RlsDatatableData, RlsDatatableFloating, RlsDatatableHeader, RlsDatatableRecord, RlsDatatableSubheader, RlsDatatableTitle, RlsDatatableTotals, RlsFieldAutocomplete, RlsFieldAutocompleteTemplate, RlsFieldDate, RlsFieldDateRange, RlsFieldDecimal, RlsFieldMoney, RlsFieldNumber, RlsFieldPassword, RlsFieldPercentage, RlsFieldReadonly, RlsFieldSelect, RlsFieldSelectTemplate, RlsFieldText, RlsFormNavigation, RlsIcon, RlsImage, RlsImageChooser, RlsImageEditor, RlsInput, RlsInputDecimal, RlsInputMoney, RlsInputNumber, RlsInputPassword, RlsInputPercentage, RlsInputSearch, RlsInputText, RlsLabel, RlsLabelCheckBox, RlsLabelRadioButton, RlsLabelSwitch, RlsMessageFormError, RlsMessageIcon, RlsModal, RlsModalSheet, RlsNavbar, RlsPagination, RlsPickerDate, RlsPickerDateRange, RlsPickerDay, RlsPickerDayRange, RlsPickerMonth, RlsPickerSelectorTitle, RlsPickerYear, RlsPoster, RlsProgressBar, RlsProgressCircular, RlsRadioButton, RlsSkeleton, RlsSkeletonText, RlsSlider, RlsSnackbar, RlsSpinner, RlsSwitch, RlsSwitchControl, RlsTabs, RlsTabularText, RlsToolbar, calculateImgDimension, rangeFormatTemplate, renderClassStatus, setErrorsI18n, useConfirmation, useDatatable, useFieldAutocomplete, useFieldSelect, useFormSingleSelectionController, useFormToggleController, useImageEditorController, useListController, useRelocationOnComponent, useResize, useSnackbar };
|
|
3921
|
+
export { ConfirmationResult, RlsAlert, RlsAmount, RlsApplication, RlsAvatar, RlsBadge, RlsBallot, RlsBottomSheet, RlsBreadcrumb, RlsButton, RlsButtonAction, RlsButtonOption, RlsButtonProgress, RlsButtonToggle, RlsCard, RlsCheckBox, RlsCheckBoxControl, RlsConfirmation, RlsContent, RlsContext, RlsDatatable, RlsDatatableCell, RlsDatatableData, RlsDatatableFloating, RlsDatatableHeader, RlsDatatableRecord, RlsDatatableSubheader, RlsDatatableTitle, RlsDatatableTotals, RlsFieldAutocomplete, RlsFieldAutocompleteTemplate, RlsFieldDate, RlsFieldDateRange, RlsFieldDecimal, RlsFieldMoney, RlsFieldNumber, RlsFieldPassword, RlsFieldPercentage, RlsFieldReadonly, RlsFieldSelect, RlsFieldSelectTemplate, RlsFieldText, RlsFormNavigation, RlsIcon, RlsImage, RlsImageChooser, RlsImageEditor, RlsInput, RlsInputDecimal, RlsInputMoney, RlsInputNumber, RlsInputPassword, RlsInputPercentage, RlsInputSearch, RlsInputText, RlsLabel, RlsLabelCheckBox, RlsLabelRadioButton, RlsLabelSwitch, RlsMessageFormError, RlsMessageIcon, RlsModal, RlsModalSheet, RlsNavbar, RlsPagination, RlsPickerDate, RlsPickerDateRange, RlsPickerDay, RlsPickerDayRange, RlsPickerMonth, RlsPickerSelectorTitle, RlsPickerYear, RlsPoster, RlsProgressBar, RlsProgressCircular, RlsRadioButton, RlsSkeleton, RlsSkeletonText, RlsSlider, RlsSnackbar, RlsSpinner, RlsSwitch, RlsSwitchControl, RlsTabs, RlsTabularText, RlsToolbar, calculateImgDimension, rangeFormatTemplate, renderClassStatus, setErrorsI18n, useConfirmation, useDatatable, useFieldAutocomplete, useFieldSelect, useFormSingleSelectionController, useFormToggleController, useImageEditorController, useListController, useRelocationOnComponent, useResize, useSnackbar };
|
|
3905
3922
|
//# sourceMappingURL=index.js.map
|