@ecohouse/ui 0.1.42 → 0.1.43
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 +130 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -2
- package/dist/index.d.ts +21 -2
- package/dist/index.js +129 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/RadioButton/RadioButton.stories.tsx +64 -0
- package/src/components/RadioButton/RadioButton.tsx +135 -0
- package/src/components/RadioButton/index.ts +2 -0
- package/src/components/index.ts +3 -0
- package/src/icons/MoonStars/MoonStarsIcon.tsx +27 -0
- package/src/icons/MoonStars/MoonStarsIcon.web.tsx +33 -0
- package/src/icons/MoonStars/index.ts +6 -0
- package/src/icons/MoonStars/moonStarsPaths.ts +7 -0
- package/src/icons/index.ts +1 -0
- package/src/icons/registry.ts +3 -0
- package/src/index.ts +4 -0
package/dist/index.cjs
CHANGED
|
@@ -9455,15 +9455,15 @@ var require_react_dom_development = __commonJS({
|
|
|
9455
9455
|
};
|
|
9456
9456
|
}
|
|
9457
9457
|
var warnValidStyle$1 = warnValidStyle;
|
|
9458
|
-
function createDangerousStringForStyles(
|
|
9458
|
+
function createDangerousStringForStyles(styles41) {
|
|
9459
9459
|
{
|
|
9460
9460
|
var serialized = "";
|
|
9461
9461
|
var delimiter = "";
|
|
9462
|
-
for (var styleName in
|
|
9463
|
-
if (!
|
|
9462
|
+
for (var styleName in styles41) {
|
|
9463
|
+
if (!styles41.hasOwnProperty(styleName)) {
|
|
9464
9464
|
continue;
|
|
9465
9465
|
}
|
|
9466
|
-
var styleValue =
|
|
9466
|
+
var styleValue = styles41[styleName];
|
|
9467
9467
|
if (styleValue != null) {
|
|
9468
9468
|
var isCustomProperty = styleName.indexOf("--") === 0;
|
|
9469
9469
|
serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ":";
|
|
@@ -9474,19 +9474,19 @@ var require_react_dom_development = __commonJS({
|
|
|
9474
9474
|
return serialized || null;
|
|
9475
9475
|
}
|
|
9476
9476
|
}
|
|
9477
|
-
function setValueForStyles(node,
|
|
9477
|
+
function setValueForStyles(node, styles41) {
|
|
9478
9478
|
var style2 = node.style;
|
|
9479
|
-
for (var styleName in
|
|
9480
|
-
if (!
|
|
9479
|
+
for (var styleName in styles41) {
|
|
9480
|
+
if (!styles41.hasOwnProperty(styleName)) {
|
|
9481
9481
|
continue;
|
|
9482
9482
|
}
|
|
9483
9483
|
var isCustomProperty = styleName.indexOf("--") === 0;
|
|
9484
9484
|
{
|
|
9485
9485
|
if (!isCustomProperty) {
|
|
9486
|
-
warnValidStyle$1(styleName,
|
|
9486
|
+
warnValidStyle$1(styleName, styles41[styleName]);
|
|
9487
9487
|
}
|
|
9488
9488
|
}
|
|
9489
|
-
var styleValue = dangerousStyleValue(styleName,
|
|
9489
|
+
var styleValue = dangerousStyleValue(styleName, styles41[styleName], isCustomProperty);
|
|
9490
9490
|
if (styleName === "float") {
|
|
9491
9491
|
styleName = "cssFloat";
|
|
9492
9492
|
}
|
|
@@ -9500,9 +9500,9 @@ var require_react_dom_development = __commonJS({
|
|
|
9500
9500
|
function isValueEmpty(value) {
|
|
9501
9501
|
return value == null || typeof value === "boolean" || value === "";
|
|
9502
9502
|
}
|
|
9503
|
-
function expandShorthandMap(
|
|
9503
|
+
function expandShorthandMap(styles41) {
|
|
9504
9504
|
var expanded = {};
|
|
9505
|
-
for (var key in
|
|
9505
|
+
for (var key in styles41) {
|
|
9506
9506
|
var longhands = shorthandToLonghand[key] || [key];
|
|
9507
9507
|
for (var i = 0; i < longhands.length; i++) {
|
|
9508
9508
|
expanded[longhands[i]] = key;
|
|
@@ -29793,6 +29793,34 @@ function MinusIcon({ size = 16, color = colors.white, strokeWidth = 2 }) {
|
|
|
29793
29793
|
) });
|
|
29794
29794
|
}
|
|
29795
29795
|
|
|
29796
|
+
// src/icons/MoonStars/moonStarsPaths.ts
|
|
29797
|
+
var MOON_STARS_SPARKLE_PATH = "M11.4167 0.75L11.8285 1.57372C12.0055 1.92771 12.094 2.1047 12.2122 2.25808C12.3171 2.39417 12.4392 2.51618 12.5753 2.62109C12.7286 2.73932 12.9056 2.82781 13.2596 3.00481L14.0833 3.41667L13.2596 3.82853C12.9056 4.00552 12.7286 4.09402 12.5753 4.21224C12.4392 4.31715 12.3171 4.43916 12.2122 4.57526C12.094 4.72863 12.0055 4.90563 11.8285 5.25961L11.4167 6.08333L11.0048 5.25961C10.8278 4.90563 10.7393 4.72863 10.6211 4.57526C10.5162 4.43916 10.3942 4.31715 10.2581 4.21224C10.1047 4.09402 9.92771 4.00552 9.57372 3.82853L8.75 3.41667L9.57372 3.00481C9.92771 2.82781 10.1047 2.73932 10.2581 2.62109C10.3942 2.51618 10.5162 2.39417 10.6211 2.25808C10.7393 2.1047 10.8278 1.92771 11.0048 1.57372L11.4167 0.75Z";
|
|
29798
|
+
var MOON_STARS_MOON_PATH = "M13.4167 8.34286C12.5427 9.876 10.893 10.9097 9.00196 10.9097C6.19739 10.9097 3.92383 8.63612 3.92383 5.83155C3.92383 3.94036 4.95766 2.29063 6.491 1.41667C3.26986 1.72208 0.75 4.43461 0.75 7.73569C0.75 11.2414 3.59195 14.0833 7.09766 14.0833C10.3986 14.0833 13.111 11.5637 13.4167 8.34286Z";
|
|
29799
|
+
function MoonStarsIcon({ size = 15, color = colors.primary, strokeWidth = 1.5 }) {
|
|
29800
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Svg23__default.default, { width: size, height: size, viewBox: "0 0 15 15", fill: "none", children: [
|
|
29801
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
29802
|
+
Svg23.Path,
|
|
29803
|
+
{
|
|
29804
|
+
d: MOON_STARS_SPARKLE_PATH,
|
|
29805
|
+
stroke: color,
|
|
29806
|
+
strokeWidth,
|
|
29807
|
+
strokeLinecap: "round",
|
|
29808
|
+
strokeLinejoin: "round"
|
|
29809
|
+
}
|
|
29810
|
+
),
|
|
29811
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
29812
|
+
Svg23.Path,
|
|
29813
|
+
{
|
|
29814
|
+
d: MOON_STARS_MOON_PATH,
|
|
29815
|
+
stroke: color,
|
|
29816
|
+
strokeWidth,
|
|
29817
|
+
strokeLinecap: "round",
|
|
29818
|
+
strokeLinejoin: "round"
|
|
29819
|
+
}
|
|
29820
|
+
)
|
|
29821
|
+
] });
|
|
29822
|
+
}
|
|
29823
|
+
|
|
29796
29824
|
// src/icons/MoreHorizontal/moreHorizontalPath.ts
|
|
29797
29825
|
var MORE_HORIZONTAL_PATH = "M6.33333 2.33333C6.70152 2.33333 7 2.03486 7 1.66667C7 1.29848 6.70152 1 6.33333 1C5.96514 1 5.66667 1.29848 5.66667 1.66667C5.66667 2.03486 5.96514 2.33333 6.33333 2.33333ZM11 2.33333C11.3682 2.33333 11.6667 2.03486 11.6667 1.66667C11.6667 1.29848 11.3682 1 11 1C10.6318 1 10.3333 1.29848 10.3333 1.66667C10.3333 2.03486 10.6318 2.33333 11 2.33333ZM1.66667 2.33333C2.03486 2.33333 2.33333 2.03486 2.33333 1.66667C2.33333 1.29848 2.03486 1 1.66667 1C1.29848 1 1 1.29848 1 1.66667C1 2.03486 1.29848 2.33333 1.66667 2.33333Z";
|
|
29798
29826
|
var ASPECT_RATIO = 4 / 13;
|
|
@@ -30180,6 +30208,7 @@ var icons = {
|
|
|
30180
30208
|
menu: MenuIcon,
|
|
30181
30209
|
menuLines: MenuLinesIcon,
|
|
30182
30210
|
minus: MinusIcon,
|
|
30211
|
+
moonStars: MoonStarsIcon,
|
|
30183
30212
|
moreHorizontal: MoreHorizontalIcon,
|
|
30184
30213
|
navigate: NavigateIcon,
|
|
30185
30214
|
noSmoking: NoSmokingIcon,
|
|
@@ -30266,6 +30295,7 @@ var iconGroups = {
|
|
|
30266
30295
|
"star",
|
|
30267
30296
|
"starFilled",
|
|
30268
30297
|
"minus",
|
|
30298
|
+
"moonStars",
|
|
30269
30299
|
"moreHorizontal",
|
|
30270
30300
|
"plus",
|
|
30271
30301
|
"refresh",
|
|
@@ -37825,6 +37855,93 @@ var styles39 = reactNative.StyleSheet.create({
|
|
|
37825
37855
|
color: colors.white
|
|
37826
37856
|
}
|
|
37827
37857
|
});
|
|
37858
|
+
var CONTROL_SIZE = 16;
|
|
37859
|
+
var DOT_SIZE = 8;
|
|
37860
|
+
var RadioButton = react.forwardRef(
|
|
37861
|
+
function RadioButton2({
|
|
37862
|
+
value,
|
|
37863
|
+
defaultValue = false,
|
|
37864
|
+
onValueChange,
|
|
37865
|
+
disabled = false,
|
|
37866
|
+
variant: _variant = "default",
|
|
37867
|
+
label,
|
|
37868
|
+
children,
|
|
37869
|
+
style,
|
|
37870
|
+
labelStyle,
|
|
37871
|
+
className,
|
|
37872
|
+
hitSlop = 8,
|
|
37873
|
+
accessibilityLabel,
|
|
37874
|
+
...rest
|
|
37875
|
+
}, forwardedRef) {
|
|
37876
|
+
const containerRef = react.useRef(null);
|
|
37877
|
+
const isControlled = typeof value === "boolean";
|
|
37878
|
+
const [uncontrolledValue, setUncontrolledValue] = react.useState(defaultValue);
|
|
37879
|
+
const isActive = isControlled ? value : uncontrolledValue;
|
|
37880
|
+
const labelContent = children ?? label;
|
|
37881
|
+
const resolvedAccessibilityLabel = accessibilityLabel ?? (typeof labelContent === "string" ? labelContent : void 0);
|
|
37882
|
+
const setContainerRef = react.useMemo(() => mergeRefs(containerRef, forwardedRef), [forwardedRef]);
|
|
37883
|
+
useApplyWebClassName(containerRef, className);
|
|
37884
|
+
const handlePress = () => {
|
|
37885
|
+
if (disabled || isActive) return;
|
|
37886
|
+
if (!isControlled) setUncontrolledValue(true);
|
|
37887
|
+
onValueChange?.(true);
|
|
37888
|
+
};
|
|
37889
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
37890
|
+
reactNative.Pressable,
|
|
37891
|
+
{
|
|
37892
|
+
...rest,
|
|
37893
|
+
ref: setContainerRef,
|
|
37894
|
+
onPress: handlePress,
|
|
37895
|
+
disabled,
|
|
37896
|
+
hitSlop,
|
|
37897
|
+
accessibilityRole: "radio",
|
|
37898
|
+
accessibilityLabel: resolvedAccessibilityLabel,
|
|
37899
|
+
accessibilityState: { selected: isActive, disabled },
|
|
37900
|
+
style: [styles40.root, disabled && styles40.disabled, style],
|
|
37901
|
+
children: [
|
|
37902
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles40.control, children: isActive ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles40.dot }) : null }),
|
|
37903
|
+
labelContent != null && labelContent !== false ? typeof labelContent === "string" || typeof labelContent === "number" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles40.label, labelStyle], children: labelContent }) : labelContent : null
|
|
37904
|
+
]
|
|
37905
|
+
}
|
|
37906
|
+
);
|
|
37907
|
+
}
|
|
37908
|
+
);
|
|
37909
|
+
var styles40 = reactNative.StyleSheet.create({
|
|
37910
|
+
root: {
|
|
37911
|
+
flexDirection: "row",
|
|
37912
|
+
alignItems: "center",
|
|
37913
|
+
alignSelf: "flex-start",
|
|
37914
|
+
gap: 6
|
|
37915
|
+
},
|
|
37916
|
+
disabled: {
|
|
37917
|
+
opacity: 0.5
|
|
37918
|
+
},
|
|
37919
|
+
control: {
|
|
37920
|
+
width: CONTROL_SIZE,
|
|
37921
|
+
height: CONTROL_SIZE,
|
|
37922
|
+
borderRadius: 20,
|
|
37923
|
+
borderWidth: 1,
|
|
37924
|
+
borderColor: colors.grey700,
|
|
37925
|
+
backgroundColor: colors.dark,
|
|
37926
|
+
alignItems: "center",
|
|
37927
|
+
justifyContent: "center",
|
|
37928
|
+
flexShrink: 0
|
|
37929
|
+
},
|
|
37930
|
+
dot: {
|
|
37931
|
+
width: DOT_SIZE,
|
|
37932
|
+
height: DOT_SIZE,
|
|
37933
|
+
borderRadius: 43,
|
|
37934
|
+
backgroundColor: colors.primary
|
|
37935
|
+
},
|
|
37936
|
+
label: {
|
|
37937
|
+
flexShrink: 1,
|
|
37938
|
+
textAlign: "center",
|
|
37939
|
+
fontFamily: fonts.sans,
|
|
37940
|
+
fontSize: 12,
|
|
37941
|
+
fontWeight: "400",
|
|
37942
|
+
color: colors.white
|
|
37943
|
+
}
|
|
37944
|
+
});
|
|
37828
37945
|
|
|
37829
37946
|
// src/utils/popoverAlign.ts
|
|
37830
37947
|
function fitsCenter(triggerRect, panelWidth, viewportWidth, padding) {
|
|
@@ -38024,6 +38141,7 @@ exports.MenuItem = MenuItem;
|
|
|
38024
38141
|
exports.MenuLinesIcon = MenuLinesIcon;
|
|
38025
38142
|
exports.MinusIcon = MinusIcon;
|
|
38026
38143
|
exports.Modal = Modal;
|
|
38144
|
+
exports.MoonStarsIcon = MoonStarsIcon;
|
|
38027
38145
|
exports.MoreHorizontalIcon = MoreHorizontalIcon;
|
|
38028
38146
|
exports.NavigateIcon = NavigateIcon;
|
|
38029
38147
|
exports.NoSmokingIcon = NoSmokingIcon;
|
|
@@ -38034,6 +38152,7 @@ exports.PlusIcon = PlusIcon;
|
|
|
38034
38152
|
exports.QrCodeIcon = QrCodeIcon;
|
|
38035
38153
|
exports.QuantityInput = QuantityInput;
|
|
38036
38154
|
exports.QuietHoursIcon = QuietHoursIcon;
|
|
38155
|
+
exports.RadioButton = RadioButton;
|
|
38037
38156
|
exports.Range = Range;
|
|
38038
38157
|
exports.RatingInput = RatingInput;
|
|
38039
38158
|
exports.RatingStarIcon = RatingStarIcon;
|