@stella-source/stellasource-dsl 3.3.0 → 3.4.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.
package/dist/cjs/index.js CHANGED
@@ -23067,9 +23067,12 @@ const NotificationBubble = styled.span `
23067
23067
  `;
23068
23068
 
23069
23069
  const Tab = ({ id, className, onClick, htmlProps, label, variant = "light", active = false, notifications, }) => {
23070
+ const notificationText = typeof notifications === "number" && notifications <= 0
23071
+ ? undefined
23072
+ : notifications;
23070
23073
  return (a$m.createElement(TabButton, { id: id, "$variant": variant, className: `${className} ${active && "active"}`, onClick: () => onClick?.(label), ...htmlProps },
23071
23074
  label,
23072
- !!(notifications && notifications > 0) && (a$m.createElement(NotificationBubble, { "$isActive": active }, notifications))));
23075
+ !!notificationText && (a$m.createElement(NotificationBubble, { "$isActive": active }, notificationText))));
23073
23076
  };
23074
23077
 
23075
23078
  const Tabs = ({ id, className, tabs, htmlProps, onTabClick, defaultActiveTab, variant = "light", isPill, }) => {
@@ -23081,6 +23084,70 @@ const Tabs = ({ id, className, tabs, htmlProps, onTabClick, defaultActiveTab, va
23081
23084
  return (a$m.createElement(TabsBar, { "$variant": variant, "$isPill": isPill, id: id, className: className, ...htmlProps }, tabs.map((tab) => (a$m.createElement(Tab, { key: `${id}-${tab.label}`, id: `${id}-${tab.label}`, label: tab.label, active: tab.label === activeTab, variant: variant, onClick: () => handleClick(tab.label), notifications: tab.notifications })))));
23082
23085
  };
23083
23086
 
23087
+ const SelectorChipComponent = styled.button `
23088
+ display: inline-flex;
23089
+ align-items: center;
23090
+ justify-content: center;
23091
+ gap: 5px;
23092
+ height: 24px;
23093
+ padding: 2px 8px;
23094
+ border-radius: 4px;
23095
+ border: 1px solid var(--grey200);
23096
+ font-size: 14px;
23097
+ line-height: 1;
23098
+ font-weight: 500;
23099
+ font-family: "inter";
23100
+ cursor: pointer;
23101
+ transition: 0.15s ease;
23102
+ background-color: var(--white);
23103
+ color: var(--charcoal);
23104
+
23105
+ ${({ $selected }) => $selected
23106
+ ? styled.css `
23107
+ background-color: var(--grey700);
23108
+ border-color: var(--grey700);
23109
+ color: var(--white);
23110
+ `
23111
+ : styled.css `
23112
+ &:hover {
23113
+ background: var(--grey50);
23114
+ }
23115
+ `}
23116
+
23117
+ &:disabled {
23118
+ background-color: var(--light-grey);
23119
+ border-color: var(--light-grey);
23120
+ color: var(--smoke);
23121
+ cursor: not-allowed;
23122
+ }
23123
+ `;
23124
+ const SelectorChipLabel = styled.span `
23125
+ display: flex;
23126
+ align-items: center;
23127
+ `;
23128
+ const SelectorChipClose = styled.button `
23129
+ display: flex;
23130
+ align-items: center;
23131
+ justify-content: center;
23132
+
23133
+ border: none;
23134
+ background: transparent;
23135
+ padding: 0;
23136
+
23137
+ cursor: pointer;
23138
+ color: inherit;
23139
+ `;
23140
+
23141
+ const SelectorChip = ({ id, className, label, selected = false, disabled = false, onClick, onClose, }) => {
23142
+ return (a$m.createElement(SelectorChipComponent, { id: id, className: className, "$selected": selected, disabled: disabled, onClick: onClick },
23143
+ a$m.createElement(SelectorChipLabel, null, label),
23144
+ selected && (a$m.createElement(SelectorChipClose, { type: "button", "aria-label": "Remove chip", disabled: disabled, onClick: (e) => {
23145
+ e.stopPropagation();
23146
+ onClose?.();
23147
+ } },
23148
+ a$m.createElement(e, { size: 16 })))));
23149
+ };
23150
+
23084
23151
  const OrderStatusComponent = styled.div `
23085
23152
  display: flex;
23086
23153
  align-items: center;
@@ -23166,6 +23233,7 @@ exports.OrderStatus = OrderStatus;
23166
23233
  exports.Pagination = Pagination;
23167
23234
  exports.PasswordInput = PasswordInput;
23168
23235
  exports.PaymentStatus = PaymentStatus;
23236
+ exports.SelectorChip = SelectorChip;
23169
23237
  exports.StellaButton = StellaButton;
23170
23238
  exports.StellaIcon = StellaIcon;
23171
23239
  exports.Styles = Styles;