@rolster/react-components 18.26.11 → 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-BumJLNfG.css → index-C8NwFlLS.css} +39 -1
- package/dist/cjs/index.js +32 -14
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/assets/{index-BumJLNfG.css → index-C8NwFlLS.css} +39 -1
- package/dist/es/index.js +33 -16
- package/dist/es/index.js.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/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
|
@@ -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;
|
package/dist/cjs/index.js
CHANGED
|
@@ -1439,6 +1439,37 @@ function RlsButtonAction({ icon, disabled, identifier, onClick, tooltip }) {
|
|
|
1439
1439
|
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 }) }))] }));
|
|
1440
1440
|
}
|
|
1441
1441
|
|
|
1442
|
+
function useFormSingleSelectionController({ disabled, formControl, onValue, value }) {
|
|
1443
|
+
const [checked, setChecked] = require$$0.useState(formControl?.value === value);
|
|
1444
|
+
require$$0.useEffect(() => {
|
|
1445
|
+
setChecked(formControl?.value === value);
|
|
1446
|
+
}, [formControl?.value]);
|
|
1447
|
+
const onSelect = require$$0.useCallback(() => {
|
|
1448
|
+
if (!disabled) {
|
|
1449
|
+
formControl && formControl.setValue(value);
|
|
1450
|
+
onValue && onValue(value);
|
|
1451
|
+
}
|
|
1452
|
+
}, [formControl, value, onValue, disabled]);
|
|
1453
|
+
return { checked, onSelect };
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
function RlsButtonOption({ icon, children, disabled, formControl, identifier, onClick, onValue, value }) {
|
|
1457
|
+
const { checked, onSelect } = useFormSingleSelectionController({
|
|
1458
|
+
disabled,
|
|
1459
|
+
formControl,
|
|
1460
|
+
onValue,
|
|
1461
|
+
value
|
|
1462
|
+
});
|
|
1463
|
+
const className = require$$0.useMemo(() => {
|
|
1464
|
+
return renderClassStatus('rls-button-option', { checked });
|
|
1465
|
+
}, [checked]);
|
|
1466
|
+
const onAction = require$$0.useCallback(() => {
|
|
1467
|
+
onSelect();
|
|
1468
|
+
onClick && onClick();
|
|
1469
|
+
}, [onSelect, onClick]);
|
|
1470
|
+
return (jsxRuntimeExports.jsxs("button", { id: identifier, className: className, onClick: onAction, disabled: disabled, children: [jsxRuntimeExports.jsx(RlsIcon, { value: icon }), children] }));
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1442
1473
|
function RlsCheckBox({ checked, disabled, identifier, onClick, rlsTheme }) {
|
|
1443
1474
|
const className = require$$0.useMemo(() => {
|
|
1444
1475
|
return renderClassStatus('rls-checkbox', { checked, disabled });
|
|
@@ -1985,20 +2016,6 @@ function RlsLabelCheckBox({ children, disabled, extended, identifier, formContro
|
|
|
1985
2016
|
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 })] }));
|
|
1986
2017
|
}
|
|
1987
2018
|
|
|
1988
|
-
function useFormSingleSelectionController({ disabled, formControl, onValue, value }) {
|
|
1989
|
-
const [checked, setChecked] = require$$0.useState(formControl?.value === value);
|
|
1990
|
-
require$$0.useEffect(() => {
|
|
1991
|
-
setChecked(formControl?.value === value);
|
|
1992
|
-
}, [formControl?.value]);
|
|
1993
|
-
const onSelect = require$$0.useCallback(() => {
|
|
1994
|
-
if (!disabled) {
|
|
1995
|
-
formControl && formControl.setValue(value);
|
|
1996
|
-
onValue && onValue(value);
|
|
1997
|
-
}
|
|
1998
|
-
}, [formControl, value, onValue, disabled]);
|
|
1999
|
-
return { checked, onSelect };
|
|
2000
|
-
}
|
|
2001
|
-
|
|
2002
2019
|
function RlsLabelRadioButton({ children, disabled, extended, identifier, formControl, onValue, reverse, rlsTheme, value }) {
|
|
2003
2020
|
const { checked, onSelect } = useFormSingleSelectionController({
|
|
2004
2021
|
disabled,
|
|
@@ -3914,6 +3931,7 @@ exports.RlsBottomSheet = RlsBottomSheet;
|
|
|
3914
3931
|
exports.RlsBreadcrumb = RlsBreadcrumb;
|
|
3915
3932
|
exports.RlsButton = RlsButton;
|
|
3916
3933
|
exports.RlsButtonAction = RlsButtonAction;
|
|
3934
|
+
exports.RlsButtonOption = RlsButtonOption;
|
|
3917
3935
|
exports.RlsButtonProgress = RlsButtonProgress;
|
|
3918
3936
|
exports.RlsButtonToggle = RlsButtonToggle;
|
|
3919
3937
|
exports.RlsCard = RlsCard;
|