@stella-source/stellasource-dsl 3.3.1 → 3.5.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 +70 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/OrderStatus/OrderStatus.stories.d.ts +1 -1
- package/dist/cjs/types/components/OrderStatus/helpers.d.ts +1 -1
- package/dist/cjs/types/components/OrderStatus/types.d.ts +1 -1
- package/dist/cjs/types/components/SelectorChip/SelectorChip.d.ts +12 -0
- package/dist/cjs/types/components/SelectorChip/SelectorChip.stories.d.ts +14 -0
- package/dist/cjs/types/components/SelectorChip/styles.d.ts +7 -0
- package/dist/cjs/types/components/SelectorChip/types.d.ts +9 -0
- package/dist/cjs/types/index.d.ts +2 -1
- package/dist/esm/index.esm.js +70 -2
- package/dist/esm/index.esm.js.map +1 -1
- package/dist/esm/types/components/OrderStatus/OrderStatus.stories.d.ts +1 -1
- package/dist/esm/types/components/OrderStatus/helpers.d.ts +1 -1
- package/dist/esm/types/components/OrderStatus/types.d.ts +1 -1
- package/dist/esm/types/components/SelectorChip/SelectorChip.d.ts +12 -0
- package/dist/esm/types/components/SelectorChip/SelectorChip.stories.d.ts +14 -0
- package/dist/esm/types/components/SelectorChip/styles.d.ts +7 -0
- package/dist/esm/types/components/SelectorChip/types.d.ts +9 -0
- package/dist/esm/types/index.d.ts +2 -1
- package/dist/index.d.ts +13 -2
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -23084,6 +23084,70 @@ const Tabs = ({ id, className, tabs, htmlProps, onTabClick, defaultActiveTab, va
|
|
|
23084
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 })))));
|
|
23085
23085
|
};
|
|
23086
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
|
+
|
|
23087
23151
|
const OrderStatusComponent = styled.div `
|
|
23088
23152
|
display: flex;
|
|
23089
23153
|
align-items: center;
|
|
@@ -23103,6 +23167,9 @@ const OrderStatusLabel = styled.span `
|
|
|
23103
23167
|
overflow: hidden;
|
|
23104
23168
|
`;
|
|
23105
23169
|
|
|
23170
|
+
// This is used as a dictionary of all of the mapped strings to icons and labels.
|
|
23171
|
+
// It isn't being enforced because of the string type.
|
|
23172
|
+
// Still, any new status mappings need to be added here as it affects the tests and stories.
|
|
23106
23173
|
var OrderStatusVariant;
|
|
23107
23174
|
(function (OrderStatusVariant) {
|
|
23108
23175
|
OrderStatusVariant["COMPLETED"] = "Completed";
|
|
@@ -23138,7 +23205,7 @@ const getOrderStatusLabel = (variant, isPurchaser) => {
|
|
|
23138
23205
|
}
|
|
23139
23206
|
};
|
|
23140
23207
|
|
|
23141
|
-
const OrderStatus = ({ variant, id, className, isPurchaser, }) => {
|
|
23208
|
+
const OrderStatus = ({ variant = "", id, className, isPurchaser, }) => {
|
|
23142
23209
|
const STATUS_ICON_MAP = {
|
|
23143
23210
|
InfoNeeded: "warning",
|
|
23144
23211
|
ViewPricing: "eye",
|
|
@@ -23157,6 +23224,7 @@ const OrderStatus = ({ variant, id, className, isPurchaser, }) => {
|
|
|
23157
23224
|
const label = getOrderStatusLabel(variant, isPurchaser);
|
|
23158
23225
|
return (a$m.createElement(OrderStatusComponent, { id: id, className: className },
|
|
23159
23226
|
iconName && a$m.createElement(OrderStatusIcon, { iconName: iconName, size: 16 }),
|
|
23227
|
+
!iconName && label !== "--" && (a$m.createElement(OrderStatusIcon, { iconName: "warning", size: 16 })),
|
|
23160
23228
|
a$m.createElement(OrderStatusLabel, null, label)));
|
|
23161
23229
|
};
|
|
23162
23230
|
|
|
@@ -23169,6 +23237,7 @@ exports.OrderStatus = OrderStatus;
|
|
|
23169
23237
|
exports.Pagination = Pagination;
|
|
23170
23238
|
exports.PasswordInput = PasswordInput;
|
|
23171
23239
|
exports.PaymentStatus = PaymentStatus;
|
|
23240
|
+
exports.SelectorChip = SelectorChip;
|
|
23172
23241
|
exports.StellaButton = StellaButton;
|
|
23173
23242
|
exports.StellaIcon = StellaIcon;
|
|
23174
23243
|
exports.Styles = Styles;
|