@sofya-ds/react 1.5.0 → 1.5.1
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 +4 -3
- package/dist/index.js +4 -3
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -2117,7 +2117,7 @@ function Dropdown({
|
|
|
2117
2117
|
const isActionVariant = variant === "action";
|
|
2118
2118
|
const isIconOnlyTrigger = iconTrigger !== void 0 && !isActionVariant;
|
|
2119
2119
|
const resolvedAppearance = resolveDropdownAppearance({ appearance, variant });
|
|
2120
|
-
const triggerSizeFamily = resolveDropdownTriggerSizeFamily(variant);
|
|
2120
|
+
const triggerSizeFamily = isIconOnlyTrigger ? "action" : resolveDropdownTriggerSizeFamily(variant);
|
|
2121
2121
|
const usesDefaultListStyle = !isLanguageVariant && !isActionVariant;
|
|
2122
2122
|
const resolvedItems = React12.useMemo(
|
|
2123
2123
|
() => isLanguageVariant ? items && items.length > 0 ? items : dropdownLanguageItems : items ?? [],
|
|
@@ -2167,7 +2167,7 @@ function Dropdown({
|
|
|
2167
2167
|
Button,
|
|
2168
2168
|
{
|
|
2169
2169
|
type: "button",
|
|
2170
|
-
variant: isLanguageVariant ? "language" : isActionVariant ? "ghost" : "dropdown",
|
|
2170
|
+
variant: isLanguageVariant ? "language" : isActionVariant || isIconOnlyTrigger ? "ghost" : "dropdown",
|
|
2171
2171
|
languageLocale: selectedLanguageLocale,
|
|
2172
2172
|
"data-appearance": resolvedAppearance,
|
|
2173
2173
|
"data-trigger-size": triggerSize,
|
|
@@ -2176,8 +2176,9 @@ function Dropdown({
|
|
|
2176
2176
|
"min-w-0",
|
|
2177
2177
|
dropdownTriggerToneClasses[variant],
|
|
2178
2178
|
dropdownTriggerSizeClasses[triggerSizeFamily][triggerSize],
|
|
2179
|
-
dropdownAppearanceClasses[resolvedAppearance].trigger,
|
|
2179
|
+
!isIconOnlyTrigger && dropdownAppearanceClasses[resolvedAppearance].trigger,
|
|
2180
2180
|
selectedTriggerToneClassName,
|
|
2181
|
+
isIconOnlyTrigger && "flex items-center justify-center",
|
|
2181
2182
|
triggerClassName
|
|
2182
2183
|
),
|
|
2183
2184
|
leftIcon: isActionVariant || isIconOnlyTrigger ? iconTriggerSize !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: iconTriggerSize }, children: iconTrigger }) : iconTrigger : void 0,
|
package/dist/index.js
CHANGED
|
@@ -1955,7 +1955,7 @@ function Dropdown({
|
|
|
1955
1955
|
const isActionVariant = variant === "action";
|
|
1956
1956
|
const isIconOnlyTrigger = iconTrigger !== void 0 && !isActionVariant;
|
|
1957
1957
|
const resolvedAppearance = resolveDropdownAppearance({ appearance, variant });
|
|
1958
|
-
const triggerSizeFamily = resolveDropdownTriggerSizeFamily(variant);
|
|
1958
|
+
const triggerSizeFamily = isIconOnlyTrigger ? "action" : resolveDropdownTriggerSizeFamily(variant);
|
|
1959
1959
|
const usesDefaultListStyle = !isLanguageVariant && !isActionVariant;
|
|
1960
1960
|
const resolvedItems = React12.useMemo(
|
|
1961
1961
|
() => isLanguageVariant ? items && items.length > 0 ? items : dropdownLanguageItems : items ?? [],
|
|
@@ -2005,7 +2005,7 @@ function Dropdown({
|
|
|
2005
2005
|
Button,
|
|
2006
2006
|
{
|
|
2007
2007
|
type: "button",
|
|
2008
|
-
variant: isLanguageVariant ? "language" : isActionVariant ? "ghost" : "dropdown",
|
|
2008
|
+
variant: isLanguageVariant ? "language" : isActionVariant || isIconOnlyTrigger ? "ghost" : "dropdown",
|
|
2009
2009
|
languageLocale: selectedLanguageLocale,
|
|
2010
2010
|
"data-appearance": resolvedAppearance,
|
|
2011
2011
|
"data-trigger-size": triggerSize,
|
|
@@ -2014,8 +2014,9 @@ function Dropdown({
|
|
|
2014
2014
|
"min-w-0",
|
|
2015
2015
|
dropdownTriggerToneClasses[variant],
|
|
2016
2016
|
dropdownTriggerSizeClasses[triggerSizeFamily][triggerSize],
|
|
2017
|
-
dropdownAppearanceClasses[resolvedAppearance].trigger,
|
|
2017
|
+
!isIconOnlyTrigger && dropdownAppearanceClasses[resolvedAppearance].trigger,
|
|
2018
2018
|
selectedTriggerToneClassName,
|
|
2019
|
+
isIconOnlyTrigger && "flex items-center justify-center",
|
|
2019
2020
|
triggerClassName
|
|
2020
2021
|
),
|
|
2021
2022
|
leftIcon: isActionVariant || isIconOnlyTrigger ? iconTriggerSize !== void 0 ? /* @__PURE__ */ jsx12("span", { style: { fontSize: iconTriggerSize }, children: iconTrigger }) : iconTrigger : void 0,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sofya-ds/react",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "Sofya React design system with official brand tokens, provider and UI components.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"motion": "^12.38.0",
|
|
60
60
|
"sonner": "^2.0.7",
|
|
61
61
|
"tailwind-merge": "^3.5.0",
|
|
62
|
-
"@sofya-ds/tokens": "1.5.
|
|
62
|
+
"@sofya-ds/tokens": "1.5.1"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@testing-library/jest-dom": "^6.9.1",
|